Transform between two local coordiante systems.

Given a local frame X and a local frame Y with hierarchy something like this:

a

b

X

c

d

Y

To get the position of a point Y in local space (p) according to X’s local coordinates (p2) I use:

p2 = X.transform.InverseTransformPoint( Y.transform.TransformPoint( p ) );

But this involves calculating the world coordinate of X and Y which involves using the transforms of a and b which are irrelevant. Is there a better way of doing this?

Hard to say. What are you trying to do? You shouldn’t need to go beyond two steps to get any position really. If you want y relative to x, it’s just x-y (+x for world).

1 Like