React VR ships with a handful of 3D primitives. We'll importprimitives like <Sphere/><Box/><Cylinder/>, and <Plane/> and explore how they can positioned in a three dimensional space.

We'll also check out some of their properties that let us change their size and polygon counts. However we are not limited to simply changing their geometry! We'll see how we can change material and texture options as well.

import React from 'react';
import {
AppRegistry,
asset,
Pano,
Text,
View,
Image,
Sphere,
PointLight,
} from 'react-vr'; export default class app extends React.Component {
render() {
return (
<View>
<Sphere
style={{
color: 'lightblue',
transform: [{translateZ: -2}]
}}
lit
heightSegments={20}
widthSegments={20}
></Sphere>
<PointLight
intensity={1}
style={{transform: [{translate: [0, 700, 700]}]}}
></PointLight>
</View>
);
}
}; AppRegistry.registerComponent('app', () => app);

Add texture for earth:

        <Sphere
style={{
color: 'lightblue',
transform: [{translateZ: -2}]
}}
lit
texture={asset('earth.jpg')}
heightSegments={20}
widthSegments={20}
></Sphere>

最新文章

  1. Constraint3:check约束 和 null
  2. SQL语句 分页实现
  3. 解决“动软代码生成器在SqlServer中会将唯一索引识别为主键&quot;的Bug
  4. 黄聪:Access-Control-Allow-Origin,JS跨域解决办法
  5. 新浪SAE数据库连接demo和说明
  6. oracle 备份和还原还有创建用户、表空间、授权
  7. 返璞归真vc++之感言
  8. Cocos2d-x 3.2编译Android程序错误的解决方案
  9. MyCat集群部署(HAProxy + MyCat)
  10. MathType需要安装一个较新版本的MT Extra(True type)字体[转]
  11. ZOJ 3511 不相交切切多边形 线段树求最大边数
  12. linux下能ping ip不能ping域名详解
  13. chromium for android v34 2dcanvas硬件渲染实现分析
  14. SpringBoot学习之SpringBoot执行器
  15. DDD实战进阶第一波(十一):开发一般业务的大健康行业直销系统(实现经销商代注册用例与登录令牌分发)
  16. 透过实现小型打包工具理解webpack
  17. 4.7 Sublime Text3 中配置 Python环境 --之上安装Sublime 3
  18. clearRect清除html5画布
  19. poj 1797 一条路径中的最小边 再找出最大的
  20. MyBatis分页

热门文章

  1. Python游戏server开发日记(二)绕过GIL启动多线程Python环境
  2. 启用QNX系统,海尔智能冰箱或成业界“宝马”
  3. Android 中View的绘制机制源代码分析 二
  4. COCOS2D-X 动作 CCSequence动作序列
  5. 新东方雅思词汇---6.1、oppose
  6. DNS隧道工具汇总——补充,还有IP over DNS的工具NSTX、Iodine、DNSCat
  7. Python使用functools模块中的partial函数生成偏函数
  8. Jq自定义的方法绑定树结构
  9. week3_notebooke1
  10. WEB前端开发常用的优化技巧汇总