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

Device Orientation Issue? #15828

Closed
farhanRIT opened this issue Feb 22, 2019 · 6 comments
Closed

Device Orientation Issue? #15828

farhanRIT opened this issue Feb 22, 2019 · 6 comments

Comments

@farhanRIT
Copy link

farhanRIT commented Feb 22, 2019

Hi, I tested this example https://threejs.org/examples/misc_controls_deviceorientation.html

And it seems that the start direction is not consistent between different orientation.

For example, in portrait mode, it will start by facing the wall (with door on left) BUT
if I turn upside down portrait mode, it will start by facing the window, the opposite of the wall with door on the left.

While on landscape mode, it will start by facing the huge window with the table on the right, while the other way of the landscape mode, it will start by facing the opposite side, facing the 3 little windows.

Shouldn't it always start by facing the same object / area of the room?
Is this a known bug?
If not, how can we start the app by facing the same object / area of the room no matter which orientation your device is currently/initially at?
Otherwise user A experience may be different than user B experience when they run the app with their devices at a different orientation.

Thanks.

@Mugen87
Copy link
Collaborator

Mugen87 commented Feb 25, 2019

I'm unable to reproduce with a Pixel 1 and Chrome. In both portrait and landscape mode the camera faces towards the three-part window (when holding the device in the same way). However, the initial orientation depends on the tilt of the smartphone.

What smartphone/browser are you using?

@looeee
Copy link
Collaborator

looeee commented Feb 28, 2019

Here's my results (Moto G6).

Portrait, 0 degrees

screenshot_20190228-182434

Landscape, 90 degrees:

screenshot_20190228-182545

Landscape, 270 degree:

screenshot_20190228-182521

@looeee
Copy link
Collaborator

looeee commented Feb 28, 2019

Here's a pen to help other people match up results to their screen orientation:

What's My Screen Orientation?

@WestLangley
Copy link
Collaborator

FWIW, from https://developer.apple.com/documentation/webkitjs/deviceorientationevent

The angles of rotation—the alpha, beta, and gamma properties—do not represent the real world orientation. They are defined as an offset from an arbitrary direction—typically, the direction in which the device was held when the orientation was first obtained.

@farhanRIT
Copy link
Author

farhanRIT commented Feb 28, 2019

Yes, those screen shots are exactly what I see. Isn't that a bug or incorrect? I mean, if you start the app / initialize the app while holding the phone in portrait angle or landscape or upside down portrait or landscape, should the world always start facing the same direction? I mean if you are making a game, you expect it always to start facing the same direction or object.

For now I manage to fix it by rotating the scene initially based on the current orientation so it will always start facing same object/ direction. Not sure if this is the only way for fixing this bug if this is a bug.

@Mugen87
Copy link
Collaborator

Mugen87 commented Mar 11, 2020

Closing. This is a device specific issue and not related to the implementation of DeviceOrientationControls.

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

No branches or pull requests

4 participants