Im trying to determine how to find the local position and rotation values of an object based on an extended parents object space. Here is an example situation:
GroundPlane (mesh)
------groupRoot (null, possibly animate, child of GroundPlane)
------CTRL (null, animated, child of groupRoot)
------ Ball (mesh, may or may not be animated, child of control)
So for example the position values are:
GoundPlane [World 0,0,0 || Local 0,0,0]
groupRoot [W 1,0,0 || L 1,0,0]
CTRL [W 2,0,1 || L 1,0,1]
Ball [W 2,0,1 || L 0,0,0]
For now assume all rotation values are 0.
What I want to find is what the local value for Ball would be based on the object space of groupRoot. The problem right now is if I use world position and then rotate GroundPlane or groupRoot all the calculations get thrown off, so I need to account for the affected position of groupRoot and any additional changes made by GroundPlane. I cant use local values for Ball because most if not all animation is done to CRTL so Balls local values do not change.
My thought is I need to get the world values for groupRoot and Ball then modify Balls values to reflect its local position in groupRoots object space. So far Ive yet to figure out an approach to achieve this. In the end I the x,y,z,h,p,b values for Ball in relation to groupRoot.
Im working in C using the messiah API, which provides me access to channel values and matrix values for objects, along with the standard C math librarys.
TIA,