This content has been marked as final. Show 5 replies
It looks to me as if you are dealing with different rotations in the top and bottom image. The axisAngle in the top image indicates which axis the cube has been rotated around from its rest position, and by how many degrees. The bottom image shows three rotations (H, P and B), not an axisAngle.
Perhaps you would get the results you are expecting if you used the .transform.rotation property of the cube model. This returns a vector containing 3 angles: rotation around the x-axis, rotation around the y-axis and rotation around the z-axis. All these angles are already in degrees.
Note that, to get to the desired orientation, the rotations are applied in order: first around the x-axis, then around the y-axis and lastly around the z-axis. Also, there are an infinite number of ways to arrive at the final rotation, so two transforms with different .rotation values may in fact have the same orientation.
Reason why I choose to go with the axislines is because its gives me much more "normal" values than a havokcontrolled object. -180 90 -180 etc...
The heading works great. Problem is pitch and bank..
This is how I convert to radians...
myaxis = member("3dscene").model("body").transform.axisangle
Havokaxisangle gives me the exact same numbers.
Tried using getworldtransform().rotation but that produced wicked rotation in 3d application.
I'll make some anim gif to show what goes wrong...
There is a known quirk in transforms that can lead to the figures you associated with Havok.
If you rotate a transform around its y-axis by setting the rotation of the transform, you can end up with strange-looking rotations such as vector(-180, 90, -180). Normally this occurs only when you set the rotation around the y-axis to a value between 90° and 270°. One solution is to set the rotation of the transform to vector(0, 0, 0), then use the rotate() method to apply the rotation for you.
vTransform.rotation = vector(0, 180, 0)
... try this:
vTransform.rotation = vector(0, 0, 0)
vTransform.rotate(vector(0, 180, 0))
Problem is I'm not doing any rotation in the code really, its a havok model. So I only output the transform.
uploaded some videos to show better what I'm having trouble with
There are in xvid, if that is a problem let me know.
axisangle, +180 on all channels and *-1 on heading.
axisangle, straight to radians.
rotation, straight to radians.
thanks for your time!
Alright, been able to recreate my problem in director by rotating a second object to my master's object axisangle.
So I get a difference in the rotation between the two.
Here's my director project, simple & clean. hopefully someone will take a look at it :)
http://walen.se/temp/showme_com.dir rightclick and save