Jump to content

Using DeviceOrientationCamera with orientation change


Recommended Posts

So when implementing the DeviceOrientationCamera on mobile, and the device changes from portrait to landscape, the camera controls don't update to the new orientation. It remembers the original portrait orientation, they don't switch over to the landscape controls. Any idea on how to correct this?


Here is an example. On mobile, start in portrait, and then rotate to landscape. You'll see the controls get all wonky.


Link to comment
Share on other sites

2 things:

1 You may need to tell the engine.  Resize for a browser is shown below. You might need to find the event for orientation switch

window.addEventListener("resize", function () {

2. I am not sure resize() is going to work, but would try that first

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...