How to calculate transformations in an object space?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  06 June 2008
Question 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.
- Lukáš Duběda | ADVERTS s.r.o. | duber's blog
  06 June 2008
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
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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 05:23 PM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.