I am modifying a game that stores object positions with a 3d vector { x, y, z } and rotation as a 3d vector with degree angles { x, y, z }.
I want to place an object in relation to a parent object accounting for its rotation. I do not have access to the game code, so I have to provide a position of the child as an absolute position.
For example, I would like to place a child object at a relative position { 50, 0, 100 }: 50 units along the x axis and 100 units up the z axis from the parent's position.
Assuming the parent object is currently at position { 0, 0, 0 } with rotation { 0, 0, 0 } the resulting absolute position for the child object would be simply { 50, 0, 100 }.
But, if the parent has a position of { 0, 0, 0 } and a rotation of { 0, 0, 90° }, the child's absolute position would be { 0, 50, 100 }.
What would be the transformation function that, given the absolute parent position, parent rotation, and relative child position, outputs the absolute position of the child (taking into account all three axes of rotation)?