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
1
vote
1 answer

Include react-vr in react-native

I would like to know if it's possible to integrate a react vr tour inside an Android and/or iOS app developed with react native. If so, how can I do it? This is just an idea but I haven't found a real solution on-line. Thanks for your…
V.Cozzatella
  • 709
  • 2
  • 9
  • 15
1
vote
1 answer

How to change the position of the component based on the camera position in react-360?

I want to change the position of my controls component based on the direction of the camera. I tried head locked surfaces in the react-360 example https://github.com/facebook/react-360/blob/master/Samples/HeadlockedSurfaces/index.js But I couldn't…
1
vote
1 answer

Render Three.js Scene in react-360?

I have a BoxGeometry added to a three.js scene. I have also added the scene in ReactInstance. The scene however doesn't seem to be rendered? I have tried this but doesn't work. just wanted to know in what react component the scene would be rendered?…
1
vote
1 answer

React 360: Safari Can't find variable: AudioContext

When initiating a react instance with react 360 in Safari, I am getting the AudioContext error. I instantiate like this: import {ReactInstance} from 'react-360-web'; function init(bundle, parent, options = {}) { const r360 = new…
bear
  • 663
  • 1
  • 14
  • 33
1
vote
1 answer

how to display panorama in android using react native

I have tried plenty of ways to display panorama image in react native. react-native-360 this is only for iOS. Creating an activity in android native code and called it from react native javascript. but content is not showing. Secondly I want to…
Syed Hassan
  • 438
  • 4
  • 19
1
vote
1 answer

Hiding the virtual reality symbol and disabling controls

Is it possible to hide the vr symbol which appears until your mouse is over the vr view? It doesn't seem possible to disable all controls. You can disable touch panning with disableTouchPanning on mobile and it still uses the device orientation. …
Jan F.
  • 1,681
  • 2
  • 15
  • 27
1
vote
0 answers

WKWebview and 360 pics

Just for testing purposes I'm trying to show a react-vr example (https://radvalentin.github.io/react-vr-samples/src/TourSample/index.html) in a WKWebView, the website loads only on the device while on the simulator the screen stays blank. Apart from…
1
vote
3 answers

How to implement Google Analytics event tracking inside a React VR project?

This is loosely written to give a basic idea of what I'm trying achieve. < VrButton onClick={props.userClick}>< /VrButton> userClick={() => this.triggerTracking} triggerTracking() { ga('send', 'event', 'myEventCategory', 'myEventAction',…
1
vote
1 answer

React-VR set camera position when replacing Pano

I'm new with react-vr and want to make a tour app. There I update the Pano pictures. When I set a new picture the camera/scene is at the same position as before loading the new picture. Here is a part of the code: render() { if (!this.state.data)…
luki
  • 31
  • 4
1
vote
1 answer

Animate a sphere (rotation)

I am trying to build my first animation, I just want to make a sphere rotate (like a head turning left or right). I looked at the Animated API but I get the following error: Transform with key of "rotateY" must be a string or number:…
Ludo
  • 5,060
  • 15
  • 53
  • 85
1
vote
1 answer

How to use Animated with Shape primitives such as Box in React-VR? Error: "Cannot add property _tracking, object is not extensible"

Trying to make Box move up and down on the Y coordinate utilizing react-vr Box and Animated components. Currently, I'm getting a Cannot add property _tracking, object is not extensible error. Code below: Component "Cube" using…
1
vote
1 answer

Animating Shader Uniforms on React VR Geometry

I am trying to animate a shader in react VR and can't seem to get the animation going.
cidicles
  • 351
  • 2
  • 8
1
vote
1 answer

react vr how to locate any item behind the scene

I am so new sorry about this question how to put plane behinf the camera view ? transform feature moves item at 2d platform not 3d any solution to this Thank you
tech snake
  • 85
  • 1
  • 1
  • 4
1
vote
1 answer

ReactVr - document is not defined

I'm trying to access the document in a react vr app. The app was created using the react-vr-cli. However, when I try to access the page I get the following error. document is not defined
Lunny
  • 852
  • 1
  • 10
  • 23
1
vote
1 answer

How can I debug my React VR code?

I am using Visual Studio Code to build a React VR app and I am trying to figure out how I can inspect my code, i.e. through chrome dev tools. I have the React Developer Tools Chrome plugin installed however it is not detecting my React VR code. Are…
Colin Sygiel
  • 917
  • 6
  • 18
  • 29