Make an object/mesh always face hover camera

Software: Away3D 4.x

Sean72, Newbie
Posted: 17 April 2014 04:32 PM   Total Posts: 28

I have a hover camera and would like to force certain objects to always face the camera.  I have tried

var lookingobject : ObjectContainer3D;
var camera: Camera3D;
var cameraController: HoverController = new HoverController(camera…);

...
//inside onEnterFrame
var tf : Matrix3D = camera.sceneTransform;
var localCamPos : Vector3D = tf.transformVector(camera.position);
lookingobject.lookAt(localCamPos);

The lookingobject does change direction with the camera, but doesn’t face the camera and doesn’t move predictably.  Should I be tracking the HoverController instead, or doing something else with the sceneTransform?

BTW, The lookingobject isn’t at the I am tracking isn’t exactly at the point the HoverController is aimed at.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X