# How to calculate transformations in an object space?

 06 June 2008 loocas czech me out!   portfolio Lukáš Duběda CEO, Lead TD duber studio™ Praha, Czech Republic 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 share quote
 06 June 2008 eek Fixer   portfolio Charles Looker Snr Technical Artist Electronic Arts Vancouver, Canada 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. share quote
 06 June 2008 CGTalk Moderation Expert 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. share quote

 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 CGSociety Society of Digital Artists www.cgsociety.org Powered by vBulletinCopyright ©2000 - 2006, Jelsoft Enterprises Ltd.