Comments (7)
My temporary workaround for this was to apply the screen rotation Q in resetPose
.
this.resetQ.copy(this.filter.getOrientation());
this.resetQ.multiply(this.worldToScreenQ);
Unfortunately, that wouldn't work on Android because of the screen locking stuff. It seems that window.orientation
just gives the locked orientation (with no indication that it is indeed locked), so the rotation was wrong if you entered VR mode form anything other than landscape-primary
.
My workaround there was to just disable screen locking, though then I had to mess with the instructions display to make it work with the fullscreen wrapper.
from webvr-polyfill.
Just to clarify this issue, it happens only when starting in landscape mode—"forward" appears 90 degrees to the left or right depending on device orientation.
from webvr-polyfill.
I've tinkered with this a bit more and still haven't come to a satisfactory solution.
To summarize, the initial world transformation should account for the device orientation, as should calls to resetPose. Unfortunately, when the orientation is locked on Android, it always returns the locked value, not the true orientation, which makes it difficult to account for.
I'm not sure how to fix this without knowing the "true" orientation.
from webvr-polyfill.
We are using a "preparation" step to access the VR mode:
- unlock the orientation (if it was locked)
- display some instructions, asking the user to turn his phone
- detect orientation changes and only display the button to enter VR when the phone is in landscape
- when the user click on the button, reset the device sensor + do all the VR stuff (fullscreen, orientation lock, distortion, etc...)
We have a trick to detect the orientation even if it's locked at the OS level, we use the event.accelerationIncludingGravity.y
value on devicemotion
, the phone should be in landscape when the value is around 0 (it works only if the phone is perpendicular to the earth actually)...
We are still using an old version of the WebVR polyfill, without the requestPresent
method, but anyhow, those steps have to be done before entering VR, so before requestPresent
.
from webvr-polyfill.
I addressed this slightly, but it's still not perfect. c6720ed
from webvr-polyfill.
Alright, should be fixed now: 716f8a1
from webvr-polyfill.
Great news! Thanks!
from webvr-polyfill.
Related Issues (20)
- Customize controls design + autohide function HOT 2
- mimeType is not defined HOT 5
- Customizing visor profile? HOT 5
- is webvr-polyfill compatible with the newest versions of THREE.js? HOT 5
- black screen is rendered when VREffects script is not used with webvr-polyfill HOT 3
- Markerless AR for web using WebVR HOT 2
- Stopped working on IOS version 12.2 HOT 2
- On Chrome 74, Enter VR Mode on mobile stops working with http:// protocol.
- devicemotion event support is removed from chrome 74 on using http:// protocol. works fine with https:// HOT 1
- "View in VR" does not remove the address bar on iOS HOT 5
- Does this still work and maybe I'm using it wrong? HOT 1
- screen.orientation.lock() failed
- Pose sensor on Android 9 in webview stopped to work HOT 2
- Is wake lock base64 video required ? HOT 3
- [QUESTION] Doesn't work with Angular in production mode HOT 1
- Remove Cardboard middle white line
- Touch doesn't work HOT 1
- The polyfill broke down on iOS? HOT 1
- host-provided navigator.getVRDIsplays returns an empty list. how does one force the polyfill to populate the list?
- Polifyll wont work on iOS - Reproducible example inside HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webvr-polyfill.