[Closed] Relative Rotation/Translation Problem
Here is my scenario:
I have two objects objA and objB not linked to each other. They each have a random rotation and position.
Here is what I want to do: Imagine that objB is linked to objA and then objA is basically given an identity matrix as its transform so that it returns to 0,0,0 and all rotation is reset. However, because objB was linked to it, objB is in exactly the same position RELATIVE to objA as it was previously.
What I want to know is how can I calculate the NEW transform matrix of objB without having to move or link anything?
I suspect this is simple, I just haven’t been able to figure it out!
Thanks in advance,
Rhys.
Must it be in tansform matrix form? If not, you could use the Expose Transform, I think.
If you use the Expose Transform helper, you can extract the different transformational data raw. (ie: The different between ObjA’s X-Rotation and ObjB’s X-Rotation).
I think I follow you…
Problem is, I don’t want to create any new objects or anything. (such as a transform helper) i just want to calculate the new transform.
Let me jump around with the concept when I get home (At the workplace now), unless someone can beat me to the punch.
try this before you assign the identity matrix to objA
$objB.transform = $objB.transform * (inverse $objA.transform)
Thanks a million Floopy.
Thats exactly what I was after. Turns out I was close but not close enough!