I’m using the universal and the arc rotate camera in my project. Its a multibe floor building to walk around. Now i would like to implement a VR button, visible only if you are using it on a mobile device.
Question: Is it possible to use the WebVR camera in a non-stereoscopic way? Only control the direction of the target by the devices motion, the rest will stay the same. (Or implement this control to the universal camera) Did anybody do this so far?
I think it would make it way more useful as most people don’t have a cardboard with them.
You are asking about the device orientation camera, which uses the, well, device orientation to control its rotation - this is not VR related, but mobile-phone related -
Ok, this is the expected behavior in that case. I think @ueli doesn’t have the rtequestPermission function defined (or at least not as a function), which is odd.
Could it be possible that this user gesture is only allowed on a DOM element?
i’ve been looking for VR examples in the babylonjs docs - but i can’t find any example that is working on iOS (sadly i can’t test android here) with the devices sensor
Usually a screen rotation event is more than enough, unless apple has changed something. I have no iphone to test with, but any user event should work correctly. It might be the pointer masking that prevents it from happening, but I am not entirely sure.
I will check with a team member that has an iphone and see what’s up. Try this example - after licking, no exception should be thrown and the device orientation should kick in - https://playground.babylonjs.com/#6MVYD5#8
another a bit stupid question - please forgive my noop-ness:
If i create the new device oriented camera (camera3) i would love to use it as the universal camera (camera2). Is there a way to just swap names of two cameras? or to replace one camera with another? I got so much code working with the “camera2”, it would be so much easier if i could call the new camera the same way (OR if i could handle the universal cameras orientation over the devices orientation, but for that i would probably need to implement it to the universal cameras type script code - i think that’s too much for me now… pfff)