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
0 answers

Full width wepage view Reactvr

I am using the ReactVr framework to work on a project. My primary goal is to set multiple hotspots and when clicked it should display full-width display with a cross button on the top to close the viewer. This is what I have done so far. I have…
0
votes
1 answer

Access to left and right projection settings in vr mode

I'm checking web-vr frameworks and looking for an availability to change the projection settings/the camera settings for left and right eye. Is it somehow possible or this is done automatically by the browser? I checked A-Frame framework from…
Tukkan
  • 1,574
  • 2
  • 18
  • 33
0
votes
1 answer

React 360 render to location from component

I have two components in my boilerplate, one of which I would like to mount only when a method is called from the other component. How could I do this? Here is my boilerplate: import {ReactInstance} from 'react-360-web'; function init(bundle,…
bear
  • 663
  • 1
  • 14
  • 33
0
votes
3 answers

Add React-VR to an existing project

I have a prototype react app which was generated using create-react-app. The app will be rendering a blend of 3d panoramic scenes with content overlays/links/etc as well as some 2d spaces. I was initially thinking of Panellum to handle the 3d scenes…
Andrew Rutter
  • 1,257
  • 2
  • 18
  • 34
0
votes
1 answer

Check device compatibilty with React VR and replacement text

Is there a way to check the compatibility of the device with React VR? I.e. it is not running on old iPads. How can I show a replacement text if the device is not compatible? Thanks!
Jan F.
  • 1,681
  • 2
  • 15
  • 27
0
votes
2 answers

Move Avatar using react vr

Am new to react vr world , i learned basics of react vr from some of the sites .And i tired some sample projects too . I followed this tutorial Although i searched from many sites i dont know how to move a avatar inside pano or any other vr…
Beckham_Vinoth
  • 701
  • 2
  • 13
  • 39
0
votes
1 answer

How to draw a circle in React VR?

I tried this but get an error "TypeError: this._viewCreator[type] is not a function". Should I not import from React Native or use another library? import {ART} from 'react-native' const { Shape, Path, } = ART class Circle extends…
Jan F.
  • 1,681
  • 2
  • 15
  • 27
0
votes
1 answer

Accessing Web Audio Context in React VR

I'm seeking inputs from people who have worked with Web Audio API in the react-vr. React-VR already has very cool components to place sounds in your scene, however, I need to go down one-step and access the audio buffer which is easily achieved by…
avroshk
  • 63
  • 9
0
votes
1 answer

React VR camera straightening control customization

When setting up React VR you get a bundle with already customized full screen button and a button for straightening up camera, which has no name and no customization options: I have changed the camera rotation principle in client.js and now the…
Mikayel Saghyan
  • 728
  • 9
  • 23
0
votes
1 answer

When using React-VR with Socket.io , I crash when importing socket.io-client

I am trying to use React-VR with Socket.io. I am crashing when I try to import socket.io-client(v2.0.4). I have to browse through examples without coming up with a solution.
Larry
  • 1
0
votes
0 answers

Get current URL in ReactVR

I'm trying to pass a variable into ReactVR via the URL. When I console.log 'window.location.pathname' from within a component, it logs 'http://localhost:3001/dddfe37b-926a-4adf-b40c-fda47bf3cf8b', even though my url is 'http://localhost:3001/vr",…
Gerard
  • 768
  • 5
  • 20
0
votes
0 answers

React-vr app on Heroku don't load client.bundle

I have a web app on Heroku based on React-vr Locally works fine, but once I've pushed to Heroku loading the VR html page I see in logs than calling "./client.bundle?platform=vr" I retrieve the 404 error (Not found), even if with bash I see the…
0
votes
3 answers

Static Buttons in React VR

I understand how vrButtons work, but how would someone go about creating buttons that are overlayed onto the vr hud. Buttons that are static, and stay on the screen regardless of how the camera is oriented.
nacerillo
  • 21
  • 2
0
votes
1 answer

Animation not working in ReactVR

It seems I'm missing one thing somewhere as I'm not seeing any errors in the console but the animation doesn't seem to be running or my scene is too heavy that the animation runs before the model is actually loaded...anything I'm missing in my…
Emmanuel Henri
  • 153
  • 3
  • 27
0
votes
1 answer

React VR - Render Three.js Elements in Scene

I used the react-vr init App to spin up a sample project and had no problem generating spheres throughout my scene using: { data.map(node => return
hotshotiguana
  • 1,520
  • 2
  • 26
  • 40