April 2020
Intermediate to advanced
716 pages
18h 55m
English
The default code in client.js attaches the mount point declared in index.js to the default Surface in the React 360 app, where Surface is a cylindrical layer that is used for placing a 2D user interface. In order to use the 3D meter-based coordinate system for a layout in 3D space, we need to mount to a Location object instead of a Surface. So, we will update client.js to replace the renderToSurface with a renderToLocation, as highlighted in the following code:
/MERNVR/client.js
r360.renderToLocation( r360.createRoot('MERNVR', { /* initial props */ }), r360.getDefaultLocation() )
This will mount our game view to a React 360 Location.
Read now
Unlock full access