If I trace the rotationY of the camera
the output is incorrect. It starts at 0, goes to 90 as expected.
After 90 degrees goes up 179 and then jumps to 0.
is campathanimator aligntopath:true? if yes, set to false.
don't know if applicable but why not simply add campathanimator.target
= targetanimator.object3d?
set campathanimator.lookat = true;
To manipulate the relative position
to the object I access the offset Number3D of the cameraPathAnimator
and update it according to the camera rotationY.
don't forget that If you have aligntopath set to true, the offset is
rotated as well, relative to object3d position.
object3d being the object you pass to the pathanimator.
Doing a project atm with very similar construction, including multiple
pathsanimators
everything is working ok, without a single calculation required in
main class
except of course the 0/1 increase values for the update().
Also you should run the latest trunk, many modifications were made on
the Path related classes. (and more will follow)
Fabrice
On Jan 25, 2009, at 10:21 PM, Patrick wrote:
Hi All,
I am trying rotate a camera around an object.
The object is assigned to a pathAnimator and the camera to another
one. Both Animators load the same path so the camera and the object
are always on the same coordinate. To manipulate the relative position
to the object I access the offset Number3D of the cameraPathAnimator
and update it according to the camera rotationY.
So this is simple trigonometry. I define the x and z offset of the
camera with cosine and sine. What I need for the calculation is the
current angle of the camera. If I trace the rotationY of the camera
the output is incorrect. It starts at 0, goes to 90 as expected.
After 90 degrees goes up 179 and then jumps to 0.
The returned value should be linear to the rotation of the object and
range from 0 - 359 degrees.
Has Anyone ideas for a workaround? Help would be appreciated
Thanks, Patrick