Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

orientation flips when looking above the horizon #14

Open
Aeva opened this issue Jul 10, 2015 · 3 comments
Open

orientation flips when looking above the horizon #14

Aeva opened this issue Jul 10, 2015 · 3 comments

Comments

@Aeva
Copy link

Aeva commented Jul 10, 2015

The WebGL VR demo works fine when I'm holding my phone in the portrait orientation, but when I hold it in horizontal orientation (such as to be used with Google Cardboard or the likes), the orientation is inverted when looking above the horizon. Looking below the horizon has the orientation as expected. The phone's auto rotate feature is turned off.

Tested this on Samsung Galaxy S6 with Firefox Beta.

I'm interested in using this for a VR project, and would be happy to help with a patch. Any idea why this is happening?

@richtr
Copy link
Contributor

richtr commented Jul 10, 2015

Firefox for Android currently does something strange with the gamma value that it returns as part of the Device Orientation Events API. Although the returned gamma is in the same (correct) range of [-90, 90) the placement of the these values does not match the gamma value placement returned in e.g. Chromium-based Android browsers. For example, where Chrome for Android returns a value of 45, Firefox for Android inexplicably decides to return a value of -45.

Most uses of device orientation rely on consistency between device orientation data between user agents. This library already manages to work around differences between iOS and Chromium-based Android browsers emitting different device orientation data. It just happens that these devices coincidentally provide mathematically equivalent device orientation data to each other.

The only potential fix right now would be to sniff for the Firefox for Android UA string and fix the gamma value in to something we expect for use in Full-Tilt.

I would prefer for Mozilla to fix this issue directly in the browser though. I don't want to start introducing hacks in to this library because once it gets fixed it will break any existing Full-Tilt usage currently deployed elsewhere on the web.

Please consider filing a bug on Bugzilla@Mozilla for Firefox for Android. If you do file a bug please paste the URL here so we can track further progress on this.

@Aeva
Copy link
Author

Aeva commented Jul 10, 2015

At least one such bug already exists in their tracker https://bugzilla.mozilla.org/show_bug.cgi?id=1176801

@richtr
Copy link
Contributor

richtr commented Jul 10, 2015

Yep, that looks like the right bug. I hope they will fix it soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants