PDA

View Full Version : rotation problem


squall_svk
02-20-2006, 09:20 AM
hi,

i'm trying to rotate object by 10 degrees in X,Y and Z at the same time. after first rotation, everything is OK, but after second is not. thanks for your help, here's the code :)


a = eulerangles 10 10 10
(eulerAngles 10 10 10)

rotate $ a
OK

inverse $.rotation as eulerangles
(eulerAngles 10 10 10) -- this is OK

rotate $ a
OK

inverse $.rotation as eulerangles
(eulerAngles 22.0451 17.9134 22.0451) -- this is what ??

Jeff_hanna
02-21-2006, 02:37 PM
You're probably encountering translation rounding error between eulerAngles and quaternions. Have you tried your code applying the rotations as quaternions?

squall_svk
02-21-2006, 02:51 PM
yes, same result with quat rotation

cyberluigi2k
02-21-2006, 04:11 PM
I think, the result you are getting is the multiplication of the two rotations. If you want to have your selected object with a given rotation you have to use:

$.rotation.controller.value = a

Using "rotate $ a" you add the given rotation to the one the object already has...

But maybe I haven't understood what you wanted to do... which result were you expecting Max to return you??

/Lui

squall_svk
02-21-2006, 04:49 PM
thanks a lot, cyberluigi2k. your way is working ok, for me

CGTalk Moderation
02-21-2006, 04:49 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.