Is it possible to move camera by x,y,z axis?
The <Scene> tag allows you to transform the camera position.
Place your entire environment inside a scene tag, and any transforms (style={{transform: [...]}}) applied to the scene will instead by applied to the camera.
With this, you can control rotation and movement from within React, but keep your users comfort in mind. Users in VR headsets shouldn't be moved too quickly through a scene, or it could induce motion sickness.
Is this still relevant in r360? or is there an alternative?
@vineethariharan Scene is no longer supported, since it creates too much confusion around local vs world coordinates.
The best way to manipulate the camera's position is to implement your own CameraController: https://github.com/facebook/react-360/tree/master/React360/js/Controls/CameraControllers. These are how the camera's orientation and position gets manipulated each frame, through clicking and dragging, scrolling, moving your phone, etc.
If you don't want to implement one, there is another approach. You can call r360.getCameraPosition() to get the raw camera position vector, and modify its contents.
In general, it's better to move the world around the camera, than to move the camera itself. This will especially become important once standalone 6DoF headsets make it onto the market, and users can really walk around your space.
So, I am creating a virtual room tour with a walk functionality. Would you suggest i move the room around or the camera in my specific usecase?
I think the easier way is moving the camera
Most helpful comment
The
<Scene>tag allows you to transform the camera position.Place your entire environment inside a scene tag, and any transforms (
style={{transform: [...]}}) applied to the scene will instead by applied to the camera.With this, you can control rotation and movement from within React, but keep your users comfort in mind. Users in VR headsets shouldn't be moved too quickly through a scene, or it could induce motion sickness.