- How can I initialize the VRCamera to be a top view (look at the scene from the top)?
- Or is there any way to set the sence and all objects as a whole, and tilt 45 at a degree
The VR camera is directly connected to the orientation of the real device. It is considered to be bad practice to change the camera’s orientation. it can cause headaches and orientation problems with certain users. It would be better to get the user to look down.
Having said that - your second question would be the right way to go if you really want to do that. There area few ways to achieve that. The best, IMO, is have a single parent mesh (just a mesh with no geometry) that will be rotated on scene init. something like this:
https://www.babylonjs-playground.com/#1A3M5C#62
https://www.babylonjs-playground.com/#XQI4UY#26
after rotate parent mesh,everything’s position is not change,the box can’t move as before,it’s positon Y and Z will be change by other box
The parent mesh’s idea is to change your world coordinates to fit the new orientation of the objects. It’s transformation should be set once (like in the first example). Afterwards, your world coordinates (the new ones, in according to the parent orientation) are different, but the objects’ local coordinates are the same. Think of it as adding a root node to all of your current root nodes.
Make sure only the root nodes get the parent mesh as parent, the rest should stay the same (of a mesh doesn’t have a parent before creating the parent mesh, it should get the parent mesh as parent)
Makes sense?