[ReactVR] Add Shapes Using 3D Primitives in React VR
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的更多相关文章
- [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 ...
- [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 ...
- [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 ...
- React VR 技术开发群 579149907
React VR 技术开发群 579149907,欢迎加入讨论!分享经验!
- [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 ...
- 平面之后3D成主流?VR全景表示不服!——全景智慧城市常诚
目前很多人对VR全景这个词汇没有明确的概念,更没有人做过全面的研究,VR全景是什么?VR全景可以做什么?不同于我们经常听到的VR色情,全景智慧城市常诚今天就来为各位做一个系统全面的介绍,深入了解之后, ...
- Three.js 快速上手以及在 React 中运用[转]
https://juejin.im/post/5ca22692f265da30a53d6656 github 的地址 欢迎 star! 之前项目中用到了 3D 模型演示的问题,整理了一下之前学习总结以 ...
- react与jQuery对比,有空的时候再翻译一下
参考资料:http://reactfordesigners.com/labs/reactjs-introduction-for-people-who-know-just-enough-jquery-t ...
- React Route
有幸你能看来我的这篇文章,这篇文章是继React后面写的Reactroute,所以你需要看看我前面整理的React笔记再来看Reactroute可能更容易 All the work we've don ...
随机推荐
- [Angular] Service Worker Version Management
If our PWA application has a new version including some fixes and new features. By default, when you ...
- 图像滤镜艺术---保留细节的磨皮之C#程序实现
上一篇博文"保留细节的磨皮滤镜之PS实现"一文中.我简介了本人自己总结的一种非常easy的磨皮滤镜,这个滤镜在磨光皮肤的同一时候,会保留非常不错的细节,今天,我将介绍使用C#程序实 ...
- iOS-为方便项目开发在pch加入一些经常使用宏定义
1.关于NSLog输出 /** * 当Xcode为Release时不输出,为Debug时输出 * * @param ... * * @return */ #ifndef __OPTIMIZE__ #d ...
- #定位系统性能瓶颈# perf
perf是一个基于Linux 2.6+的调优工具,在liunx性能測量抽象出一套适应于各种不同CPU硬件的通用測量方法,其数据来源于比較新的linux内核提供的 perf_event 接口 系统事件: ...
- mysqlbinlog高速遍历搜索记录
目标,开发者说有个数据莫名其妙加入了.可是不知道是从哪里加入的.并且应用功能里面不应该加入这种数据,为了查清楚来源,所以我就准备去binlog里面找了.可是binlog有好几个月的数,我这样一个个my ...
- python fuzzy c-means demo
摘自:http://pythonhosted.org/scikit-fuzzy/auto_examples/plot_cmeans.html#example-plot-cmeans-py,加入了自己的 ...
- 【POJ 2482】 Stars in Your Windows
[题目链接] http://poj.org/problem?id=2482 [算法] 线段树 + 扫描线 [代码] #include <algorithm> #include <bi ...
- HD-ACM算法专攻系列(15)——Quoit Design
问题描述: 源码: 经典问题——最近邻问题,标准解法 #include"iostream" #include"algorithm" #include" ...
- 利用bat批处理——实现数据库的自动备份和删除
之前见别人一直在玩批处理,最近公司也在用,就顺便学习下: 首先创建一个 txt文件 命名BackupDataBase 并修改后缀为.bat 编写两条命令: sqlcmd -S . -E -Q &qu ...
- <改变imageView的颜色和状态栏>
1. import android.content.Context; import android.content.res.TypedArray; import android.support.ann ...