
Well almost... transforming back works a little different.
You know that your point (in the new local system) is newx, newy, newz, whereas all new* values indicate how much you need to go along each of the local system's axes to find the point within the local system. In the local system, these axes are (1, 0, 0), (0, 1, 0), and (0, 0, 1), so when you do this for your point you correctly get
newx * (1, 0, 0) + newy * (0, 1, 0) + newz * (0, 0, 1) = (newx, newy, newz)
(i.e. you can seperate your point into length values for all axes, and the other way round) However, in the global coordinate system, these axes are X, Y, and Z respectively (recall the last example here). Now, you can do the same as before, so you do
newx * X + newy * Y + newz * Z
to get your point. But wait! What about the offset we had last time? Of course, you need to revert that one too. This finally gives you:
A = newx * X + newy * Y + newz * Z + P
I hope this helps,
Cheers, Wernaeh
