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>

[ReactVR] Add Shapes Using 3D Primitives in React VR的更多相关文章

  1. [ReactVR] Add Lighting Using Light Components in React VR

    In order to illuminate a scene containing 3D objects a lighting setup is required. In this lesson we ...

  2. [ReactVR] Render Custom 3D Objects Using the Model Component in React VR

    React VR isn't limited to simple 3D primitives. By using the <Model/> Component we can place a ...

  3. [ReactVR] Start a Virtual Reality Project Using the React VR CLI

    We will learn how to set up a React VR project, run the development mode with hot reloading, and tak ...

  4. React VR 技术开发群 579149907

    React VR 技术开发群 579149907,欢迎加入讨论!分享经验!

  5. [ReactVR] Animate Text, Images, Views, and 3D Elements Using the Animated Library in React VR

    Motion is an important aspect of a complete immersive experience, therefor we are going to look into ...

  6. 平面之后3D成主流?VR全景表示不服!——全景智慧城市常诚

    目前很多人对VR全景这个词汇没有明确的概念,更没有人做过全面的研究,VR全景是什么?VR全景可以做什么?不同于我们经常听到的VR色情,全景智慧城市常诚今天就来为各位做一个系统全面的介绍,深入了解之后, ...

  7. Three.js 快速上手以及在 React 中运用[转]

    https://juejin.im/post/5ca22692f265da30a53d6656 github 的地址 欢迎 star! 之前项目中用到了 3D 模型演示的问题,整理了一下之前学习总结以 ...

  8. react与jQuery对比,有空的时候再翻译一下

    参考资料:http://reactfordesigners.com/labs/reactjs-introduction-for-people-who-know-just-enough-jquery-t ...

  9. React Route

    有幸你能看来我的这篇文章,这篇文章是继React后面写的Reactroute,所以你需要看看我前面整理的React笔记再来看Reactroute可能更容易 All the work we've don ...

随机推荐

  1. [SharePoint][SharePoint Designer 入门经典]Chapter8 XSLT数据试图和表单

    本章概要: 1.不是利用XSLT web部件 2.使用XSLT web部件创建数据试图 3.使用XSLT表单web部件创建自定义表单 4.利用自定义动作执行列表表单

  2. NEFU 2

    其实就是筛选素数. 如,若能被2是质数,则2的倍数全是合数.如此循环. #include <iostream> #include <math.h> #include <c ...

  3. Bootstrap警告

    警告(Alerts)向用户提供了一种定义消息样式的方式.它们为典型的用户操作提供了上下文信息反馈. 警告(Alerts) 步骤: 1.创建一个 <div> 2.并向其加入一个 .alert ...

  4. 2015 Multi-University Training Contest 2 1006 Friends 壮压

    题目链接 题意:t 组測试数据,每组測试数据有 n个人,m条关系 每条关系能够是 "线上关系" 或者 "线下关系". 要求每一个人的线上关系(条数) == 线下 ...

  5. UVA 11542 Square 高斯消元 异或方程组求解

    题目链接:点击打开链接 白书的例题练练手. . . P161 #include <cstdio> #include <iostream> #include <algori ...

  6. JavaScript(js)对象常用操作,JS操作JSON总结

    数据类型判断可以通过一元操作符typeof,此操作符可以判断大部分JS数据类型. 也可以通过instanceof来判断.如: var a = []; alert(typeof a); // objec ...

  7. [HDU 5542] The Battle of Chibi

    [题目链接] http://acm.hdu.edu.cn/showproblem.php?pid=5542 [算法] 树状数组优化DP [代码] #include<bits/stdc++.h&g ...

  8. 安卓input框获取焦点时,底部按钮会顶上去的解决方法

    var h = document.body.scrollHeight;window.onresize = function(){ if (document.body.scrollHeight < ...

  9. 像素点的Hessian矩阵

    最近开始学习图像处理相关知识,碰到对像素点求黑塞矩阵查了资料才搞懂. 给定一个图像f(x,y)上的一点(x,y).其黑塞矩阵如下: 因为导数的公式是f'(x)=(f(x+dx)-f(x))/dx在数字 ...

  10. mysql update join优化update in查询效率

    数据库版本:5.6.16 update in 修改数据,结果执行时间过慢,一直不出结果. SQL语句及执行计划如下: UPDATE erp_order_extra SET last_time=1231 ...