zoukankan      html  css  js  c++  java
  • [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>

  • 相关阅读:
    FFT-C语言
    C语言解析WAV音频文件
    图基(Tukey)检验
    方差分析中均值比较的方法
    模拟信号采样过程
    FS,FT,DFS,DTFT,DFT,FFT的联系和区别
    枚举enum类型
    样本概率统计
    宏和内联函数
    变量的生存期和存储分配
  • 原文地址:https://www.cnblogs.com/Answer1215/p/8429898.html
Copyright © 2011-2022 走看看