React VR — Facebook 开源的使用 React 构建 VR 应用

栏目: 服务器 · 发布时间: 7年前

内容简介:React VR — Facebook 开源的使用 React 构建 VR 应用

React VR 可让您使用 JavaScript 构建 VR 应用程序。它使用与 React 相同的设计,让您通过声明式的组件构建丰富的 VR 世界和 UI。

React VR 是为 VR 应用而创建的框架,运行在 Web 浏览器中。它将现代 API(例如 WebGL 和 WebVR)与 React 的声明能力结合起来,通过各种设备提供适用于消费者的体验。

示例代码:

import React from 'react';
import {AppRegistry, Pano, Text, View} from 'react-vr';
class WelcomeToVR extends React.Component {
  render() {
    // Displays "hello" text on top of a loaded 360 panorama image.
    // Text is 0.8 meters in size and is centered three meters in front of you.
    return (
      <View>
        <Pano source={asset('chess-world.jpg')}/>
        <Text
          style={{
            fontSize: 0.8,
            layoutOrigin: [0.5, 0.5],
            transform: [{translate: [0, 0, -3]}],
          }}>
          hello
        </Text>
      </View>
    );
  }
};
AppRegistry.registerComponent('WelcomeToVR', () => WelcomeToVR);

以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

HTTP Developer's Handbook

HTTP Developer's Handbook

Chris Shiflett / Sams Publishing / 2003-3-29 / USD 39.99

The largest group with an unsatisfied demand for a good book on HTTP is the worldwide group of Web developers. A good book on HTTP can help new and old Web developers alike, as a thorough understandin......一起来看看 《HTTP Developer's Handbook》 这本书的介绍吧!

随机密码生成器
随机密码生成器

多种字符组合密码

MD5 加密
MD5 加密

MD5 加密工具

html转js在线工具
html转js在线工具

html转js在线工具