View Full Version : Get Local Rotation One object relate another


boogiboy
08 August 2007, 07:34 PM
Hi guys, i need to get local rotation of one object relate of another. But it should calculate 360 degree. The way trought angle between two vectors not valid because it use 180 degree freedom. Thanks a lot.

Piddu
08 August 2007, 09:42 PM
Get the global matrix of both the objects. Then multiply the matrix of the object you want to know the relative rotation for the inverse matrix of the other object. Then you'll need to
find some conversion from matrix to euler angles somewhere, probably there should be something like that even in the transform node documentation.

Hope this is helpful.

Ciao

boogiboy
08 August 2007, 02:15 PM
Hm that interesting, I will try to get those angles trought those equation...

http://upload.wikimedia.org/math/8/f/b/8fb413e364f891f754a9df5394905deb.png rotation about the x-axis http://upload.wikimedia.org/math/9/1/4/914c40bb9a61888f9c71f0279a71575d.png rotation about the y-axis http://upload.wikimedia.org/math/1/4/3/14368d2db9fca2be6bcfa55744ed2c2c.png rotation about the z-axis


Thanks for your help :)

Piddu
08 August 2007, 04:35 PM
Remember always to consider the order in which the rotation is applied, cause a different order with the same rotation values for X, Y and Z, create a different orientation/rotation.

This is another problem relative to the euler angles.
Damn!

anyway you can use these and find more with google:
http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToEuler/index.htm
http://www.mathworks.com/access/helpdesk/help/toolbox/aeroblks/index.html?/access/helpdesk/help/toolbox/aeroblks/directioncosinematrixtoeulerangles.html&http://www.google.co.uk/search?q=matrix+to+euler+angles&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-GB:official&client=firefox-a

Bye

katisss
09 September 2007, 08:20 AM
i have to do something similar.
Did this approach work out?

CGTalk Moderation
09 September 2007, 08:20 AM
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.


1