So when I mouseOver my object, I get the localX, localY and localZ, but how can I convert that to globalX, globalY and globalZ if my object has rotations?
Anyone got a piece of code to calculate that?
MouseEvent3D globalX, globalY and globalZSoftware: Away3D 4.x |
||
patmat, Newbie
Posted: 31 October 2011 06:19 PM Total Posts: 8 So when I mouseOver my object, I get the localX, localY and localZ, but how can I convert that to globalX, globalY and globalZ if my object has rotations? Anyone got a piece of code to calculate that? |
||
Somokon, Member
Posted: 31 October 2011 11:49 PM Total Posts: 75 [ # 1 ] Transform the point in local coordinates to global coordinates with the object’s transform matrix. I think object.transform is the right matrix to use, but I might be wrong.
global = object.transform.transformVector(new Vector3D(localX, localY, localZ));
|