This content has been marked as final.
Show 5 replies

1. Re: From axisangle to radians in 3d application.
James Newton, ACP Jun 10, 2007 5:19 AM (in response to walfridson)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 xaxis, rotation around the yaxis and rotation around the zaxis. All these angles are already in degrees.
Note that, to get to the desired orientation, the rotations are applied in order: first around the xaxis, then around the yaxis and lastly around the zaxis. 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. 
2. Re: From axisangle to radians in 3d application.
walfridson Jun 15, 2007 12:24 PM (in response to walfridson)Thanks
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
(((myaxis[1][2]*myaxis[2])+180)*(pi/180))
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... 
3. Re: From axisangle to radians in 3d application.
James Newton, ACP Jun 18, 2007 5:06 PM (in response to walfridson)There is a known quirk in transforms that can lead to the figures you associated with Havok.
If you rotate a transform around its yaxis by setting the rotation of the transform, you can end up with strangelooking rotations such as vector(180, 90, 180). Normally this occurs only when you set the rotation around the yaxis 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.
Instead of...
vTransform.rotation = vector(0, 180, 0)
... try this:
vTransform.rotation = vector(0, 0, 0)
vTransform.rotate(vector(0, 180, 0)) 
4. Re: From axisangle to radians in 3d application.
walfridson Jun 19, 2007 8:35 AM (in response to walfridson)Thanks James
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.
http://walen.se/temp/axisanglefix.avi
axisangle, +180 on all channels and *1 on heading.
http://walen.se/temp/rawaxis.avi
axisangle, straight to radians.
http://walen.se/temp/rawrotation.avi
rotation, straight to radians.
thanks for your time! 
5. Re: From axisangle to radians in 3d application.
walfridson Jun 21, 2007 12:31 PM (in response to walfridson)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
cheers