I have two objects in 3 dimensions, one of them (Child
) is attached to the other one (Parent
) using the offset between them (XYZ - position and rotation).
Using the Vector3
library, how can I find that Child
offsets from the Parent
?
Further explanation: let's say we have the parent at position X:0 Y:0 Z:0 with rotations RX:0 RY:0 RZ:0
, and there is an attached Child to it with the offset X:10 Y:10 Z:10, RX:90 RY:45 RZ:90
(which is what I want to know). Supposedly, I had the Parent with a different position and rotation, how can I get the offset between it and the Child (which in this case, it should be X:10 Y:10 Z:10, RX:90 RY:45 RZ:90
) (in another word, I want the Child
position and rotation as the Parent
is the center of the map)
I've tried simple math and some other ways on the internet but with no success, since I'm pretty bad at calculating rotations (since vector3 libraries are pretty identical, so as Math libraries, any language should be fine).