Questions tagged [react-360]

React VR lets you build VR apps using only JavaScript. It uses the same design as React, letting you compose a rich VR world and UI from declarative components.

React VR is a framework for the creation of VR applications that run in your web browser. It pairs modern APIs like WebGL and WebVR with the declarative power of , producing experiences that can be consumed through a variety of devices. Leveraging web technologies and the existing React ecosystem, React VR aims to simplify the construction of 360 experiences and democratize the creation of VR content. If you're familiar with React, you can now build in VR – learn once, write anywhere. React VR takes heavy inspiration from .

It was built and open sourced by Facebook in cooperation with Oculus and was first released on December 13th 2016.

While React VR is available as a standalone npm package, it's much easier to set up a new project by using the React VR CLI tool.

npm install -g react-vr-cli

Once installed, the CLI can be used to create a new project by running:

react-vr init PROJECT_NAME

Below is the starter template that your new project will contain:

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);

Official links

119 questions
0
votes
1 answer

Issue in npm config issue, stuck at loading phase

installed successfully "sudo npm install -g react-360-cli" and created project "react-360 init helloDev" when press the "npm install" its stuck somewhere and not load the project before the react360 modules were not downloaded properly then it…
0
votes
0 answers

Add Google maps/Google Earth VR to React360 app

Am pretty new to react360. I would like to integrate google maps with react360, preferably google earth VR if possible. I have tried out google-maps-react, but it doesn't work on react360 but only made to React. I have no idea how to use…
Nicanor Korir
  • 63
  • 1
  • 10
0
votes
1 answer

Image specification needed for React-360 pano cubemap

When I try to render my cubemap in react360 I am getting a pitchblack viewport in the browser and in the console I have : WebGL-0x20848408300 texture bound to texture unit is not renderable, it may be none power of 2 and have incompatible texture…
Tim Dowd
  • 205
  • 4
  • 12
0
votes
1 answer

How to make React360 Vrmode work on ios device?

I want to make React360 split scene work on an ios device, I have tried to use webvr-polyfill , but I dont know how to use it sorry for my language, I am not a native speaker
0
votes
0 answers

_AsteroidsReact 360 Module2.default.printOut is not a function (Unable to call module method from client.js)

For my react 360 project, I have the following code in my client.js file: import { ReactInstance } from 'react-360-web'; import AsteroidsModule from './AsteroidsModule'; import * as THREE from 'three'; function init(bundle, parent, options = {}) { …
Dan Rubio
  • 4,709
  • 10
  • 49
  • 106
0
votes
1 answer

Props are undefined on React initialization. Why?

I am creating a VR application with React 360. What I am trying to do is to eventually create an application as shown here Facebook VR multi surface example. I am taking the code for that example and am trying to fit it into my application. However…
Dan Rubio
  • 4,709
  • 10
  • 49
  • 106
0
votes
0 answers

Assistance with understanding why my React state is not updating

I am creating a react 360 (formerly reactvr) project using MobX. I had such a pain setting up with Redux that I chose to use MobX for simplicity. What I am trying to recreate is the project that is presented in this youtube video React VR…
Dan Rubio
  • 4,709
  • 10
  • 49
  • 106
0
votes
2 answers

What is the difference between these two View components?

I am looking at react-360 and react-native code and found the following examples concerning the View component. class ViewColoredBoxesWithText extends Component { render() { return (
Dan Rubio
  • 4,709
  • 10
  • 49
  • 106
0
votes
1 answer

react-vr integrate a button for enter in vr mode

Problem: hi, my problem is that i should include a button for enter in a vr mode how with a-frame or krpano and i have see in a video on youtube this button in an exemple but around the web I could not find a way or a guide to activate the "view in…
V.Cozzatella
  • 709
  • 2
  • 9
  • 15
0
votes
0 answers

Cannot read property 'rotationOffset' of undefined

I am using react-vr and trying to use the json object to render image, but I'm getting an error that the browser cannot read property 'rotationOffset' of undefined. Below is my code for reference. static defaultProps = { portal:…
0
votes
1 answer

React-360: Use external Image as Scene Background

i have been trying for some time to set an external image over the environment. This is my index.js: import React from 'react'; import { AppRegistry, StyleSheet, Text, asset, View, VrButton, } from 'react-360'; import…
PinkyTV
  • 118
  • 2
  • 14
0
votes
1 answer

Cannot read property 'openOverlay' of undefined from NativeModules using ReactVr

I'm building a project using reactVr and facing an issue while using DOM elements in it. I followed the example from DomoverlaySample from facebook's github and ended up with a problem. Basically, in my index.vr.js I called the Monitor.js, which I…
0
votes
1 answer

React 360 - Display the text 180 degrees (behind the users initial view)

I have just started exploring react 360 by installing the initial project. The initial project always displays text on initial load in front of the user. I am trying to move the text to the right using absolute position but after it goes outside of…
user3652337
0
votes
2 answers

React-360 Image URI not Visible

The react-360 instructions seem very clear and simple: But I've manually uploaded…
mattferrin
  • 607
  • 2
  • 8
  • 19
0
votes
1 answer

Is it possible to call a react-360 method from a native Module?

I am working on a VR project which is has 2 user roles, a leader (who sets up and configures a VR session) and clients (who connect to this session). I am using a Native module to perform a DOM overlay in which several buttons related to session…