|06 June 2008||#1|
czech me out!portfolio
CEO, Lead TD
Praha, Czech Republic
Join Date: Mar 2003
How to calculate transformations in an object space?
Hi there, first off, the topic name is a bit misleading. All I need to know is the way to calclate an object's full transform as if it was some other object's child.
I mean, let's imagine. I have three points. $Point01 - $Point03
$Point01 is the parent of all the other points. So when I rotate/move/scale it, all the children get transformed correctly according to that. The thing I want to achieve is a script tha'd calculate the $Point03's transformation based off of $Point02's transformation change. As if the $Point03 was a direct child of the $Point02.
How do I go about it? I understand matrices as well as quats, the only problem I have is finding the right "formula" for calculating the $Point03's transform property and assigning it to it.
I know that multiplying $Point03's transform by an inverse of $Point02's transform will get me into the $Point02's space, but what then?
Any tips or hints will be greatly appretiated.
|06 June 2008||#2|
Snr Technical Artist
Join Date: Feb 2002
To get the transform 'space' of any object relative to another you do inverse matrix multiplication.
tm = $point3.transform * inverse $point2.transform
Say you have three points a,b,c. With b,c parented to a. If you want to get c's transform to behave as if it was parented to b's. You'd firstly get b's space relative to a's:
tm = (b.transform * inverse a.transform)
Then you'd transform c about this space relative to b.transform.
c.transform = tm * b.transform
Local space doesnt really exist is all just about reference and offset - essentially your setting a reference for that object to exist in. Me > Earth > Sun > Galaxy etc, etc..
Disclaimer: My opinions are not those of my employer.
|06 June 2008||#3|
Join Date: Sep 2003
Thread automatically closed
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.
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
|Thread Closed share thread|