Arbitrary direction for DeviceOrientationControls

266 views Asked by At

When using DeviceOrientationControls, I need to allow the user to reset their view to an arbitrary direction. Basically if I'm sitting in a chair with limited range of head motion, I want to allow the camera to switch to a different direction (how I trigger that change is not important).

alphaOffsetAngle works great for resetting the view to look left, right, or behind, but not for looking up or down (or left/right, but rotated).

I tried adding offset angles for Beta and Gamma, but that isn't as straightforward as I hoped. I also tried adding the camera to an Object3D and rotating the parent. That sortof worked, but the controls got all wonky when the camera's parent was rotated.

lookAt() is pretty much what I want, but the DeviceOrientationControls update() seems to blow that away.

Does anyone have a working example of this arbitrary camera direction with the deviceorientationcontrols?

This question is similar these, but I have not found a workable solution: Add offset to DeviceOrientationControls in three.js

and: DeviceOrientationControls.js - Calibration to ideal starting center

0

There are 0 answers