updating HoverController with current camera view

Software: Away3D 4.x

Beek, Member
Posted: 14 March 2015 01:40 AM   Total Posts: 67

Hi,

I’m switching between a cameraController for drag, and a gryo controller for VR.

If the cameraController is activated by drag, it returns to it’s original default viewing position.

How do I update the cameraController.panAngle/tiltAngle or lookAt etc with the current camera position?

I’ve tried copying the camera.forwardVector into the cameraController.lookatPosition etc with no luck.

Any clues?

   

Beek, Member
Posted: 14 March 2015 10:06 PM   Total Posts: 67   [ # 1 ]

I can get the pan value I need with this

var q:Quaternion = new Quaternion;
      
q.fromMatrix(camera.transform);
        var 
pan:Number q.toEulerAngles(Vector3D.Y_AXIS).180/Math.PI


As soon as I do any calculation on that Quanternion, and apply the hover controller, even tho none of the maths affect the camera, or the hover controller, the camera flips upside down.

It’s very strange, whatever maths is done on quaternion, even if it’s cloned, copied or whatever, flips the camera.

Anyone got a clue how to get around this problem?

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X