zoukankan      html  css  js  c++  java
  • [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'll walk through the available lighting components and create a common outdoor lighting setup.

    This includes the components: <AmbientLight/>, which affects all objects in the scene equally and from all directions; <DirectionalLight/>, which illuminates all objects equally from a given direction; <PointLight/>, which spreads outward in all directions from one point; and finally <SpotLight/>, which spreads outwards in the form of a cone.

    A handy demo for <SpotLight/> can be found here.

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

  • 相关阅读:
    DVWA SQL Injection High
    DVWA SQL Injection Medium
    Sagemath在ctf密码学中的使用
    Python杂记
    Elgamal&RSA小结
    攻防世界-密码学-onetimepad
    攻防世界-密码学-sleeping-guard
    攻防世界-密码学-streamgame1
    GACTF2020密码学部分详解
    攻防世界-密码学-xor_game
  • 原文地址:https://www.cnblogs.com/Answer1215/p/8429900.html
Copyright © 2011-2022 走看看