Android : ThreeJS Orbit Control - relative to device orientation

on Thursday, March 26, 2015


I have a ThreeJS scene that allows users to explore it with their mobile device using Orbit Controls. When the scene starts, it orients itself. I need to have it start relative to the device so that when the user enters, they always see the same thing. I think I can do this by having my camera on OrbitControl and my scene objects on another.


When the user clicks a button, I lock the scene objects in place, but keep the camera using the OrbitControls.


The problem I face is that I need to recognize when the user clicks at incremental angles. If the scene were normalized, I would want to recognize "Are they clicking between 0 to 45 degrees on a Y axis rotation. This is very easy to do without the scene objects rotated, but I cannot figure out how to make this happen when both the camera and the scene objects are rotated.


0 comments:

Post a Comment