I'm learning about D3D and coordinate spaces while working with the kinect (in C++). While I can draw skeleton positions easily using Direct2D, I am curious as to how to draw these positions using direct3D 11 and what coordinate space transformations I would need.
A simple example: I would like to translate a cube based on the motion of the left hand. Tracking the left hand joint, I can get skeleton locations. However, how would I convert these locations to something the world space of the cube would understand?
I attempted a solution by doing:
- Convert skeleton locations to depth using SkeletonToDepth conversion - giving me results in screen space.
- Map the screen space point back into object space using
XMVector3UnProject(...)
, i.e. essentially a ray picking solution.
While this is fine, is there a more efficient way that does not involve mapping back into object space and that would allow me to work directly with in screen space or at least, projection space?