My goal was to code an OpenStreetMap 3D Viewer, running on any device:
A) On simple monitors in plain mono
B) On smartphones in stereo to use a Cardboard
C) Om Oculus Quest immersive
What is the best way to do this with BJS?
First I used WebVR and it it was ok:
A) On simple monitors you see that VR logo and gets key and pointer controls
B) On smartphones you touch that logo and gets stereo and orientation controls
C) Om Oculus Quest you “shoot" that logo and gets immersive and full controls
BJS WebVR hase a niche fallback to stereo, even if there is no WebVR supported on the device.
Then someone form BJS told me: WebVR is out, use WebXR
and for older devices, use polyfill.
A) On simple monitors you see no VR logo: ok (VR+polyfillXR)
c!) On Oculus Quest you shoot that logo and gets immersive, fine. (XR)
B) On smartphones you touch that logo and gets stereo (nothing+polyfillXR), but:
“The XR experience helper doesn’t have this cardboard-style compensation"
. The fallback to stereo will only work if I use polyfill
. The screen solution is bad in portrait mode (see also this)
. The stereo view is wrong
There is a fine code running via WebVR. Why don’t we use it for WebXR too?
Sure, I could use WebVR on smartphones (if no WebXR is given) to get Cardboard mode.
But the APIs of WebVR and WebXR are quite different.
To code my functions, some code needs to be written twice,
not nice, but the only way I see.
I consider to write a class Device, hiding all the differences.
I need to get/set orientation/position of the camera(body) and device(head)
But that may be a topic for an extra question.