axis and angle are confused with reloading in landscape mode
env3d opened this issue · 10 comments
Description:
- Visit the example page with phone: http://immersive-web.github.io/webvr-polyfill/examples/
- Turn phone into landscape mode.
- Refresh
- Axis are now confused, also the box is not in the center of the screen
Additional Information:
- webvr-polyfill version: 0.10.3
- Browser name/version/release channel: Chrome M65
- Operating System: Android
I see what the issue is. This is from the Chrome m65 specific fix which uses deviceorientation -- starting in landscape doesn't have the correct transformation. Thanks for reporting! I'll patch this tomorrow.
Thanks for looking into this. Could you also look at why the pose is not centering properly? Cheers!
Do you see that only in Chrome m65? I see an initial jump a second after magic window starts. Not sure what's up with that. For better or for worse, this code path is hot fix, only temporarily for Chrome m65 builds (due to #307)
Yes this only happens in m65. I uninstalled the upgrade and the problem went away.
I realized it's a hotfix but I have demos and product deployment coming up so the platform update may not make it in time. Thanks
@jsantell, for the webvr-polyfill code path that uses the new Sensor APIs (shipping in https://github.com/immersive-web/webvr-polyfill/releases/tag/v0.10.3) you could define the screen coordinate system to be used:
let sensor = new RelativeOrientationSensor({frequency: 60, referenceFrame: "screen"});
When referenceFrame
is set to "screen
", the native implementation handles the transformation for you. We added this feature to the spec and implemented it in Chrome based on your earlier feedback. Hope you like it!
For the context, see immersive-web/cardboard-vr-display#10 (comment)
Edit: for feature detection story, see immersive-web/cardboard-vr-display#10 (comment)
Yes this only happens in m65. I uninstalled the upgrade and the problem went away.
I realized it's a hotfix but I have demos and product deployment coming up so the platform update may not make it in time. Thanks -- @env3d
The problem will go away without the patch, but then you're limited to only one axis of rotation due to Chrome m65 regression. Unsure if there'll be a platform update in m65 for the frequency issue.
@anssiko This sounds great! To clarify, Chrome m67 will have the feature detection, but the screen
referenceFrame
has been implemented since m65? Would it be safe to assume the reference frame works on future implementations, removing the custom transformations?
@env3d can you confirm if the patch here works for you? tested on all initial starting orientations and transitioning to the other orientations, Chrome m65 and Firefox/Android 58.0.2 immersive-web/cardboard-vr-display#20
Thanks @jsantell for fixing this so quickly. I'm out of office this morning but will check it once I'm back in. Cheers.