Hello,

Please can anybody tell me how can I move a 3d model
I am making a 3d human body tracking and i have reached the stage that i extract the position of the main parts of the human body using a camera (wrist, elbow , shoulder, waist,knee & ankle) i am using c++

now i need to apply this position(from each frame) on a 3d model
any suggestions?

Well first, you say (wrist, elbow, shoulder, etc.) so I guess what you have to start with is not the actual position and orientation of each part of the body, but the position of each joint of the body. Since parts are between joints, you need to transform those joint positions to part position and orientation (called just "pose"). Essentially, to do that, look up "3D pose from 3 points" or something like that, it's a classic math problem, and not very hard. Assuming you have enough points to start with, you can use that method with, for example, the points on the wrist and those on the elbow to find the pose of the forearm.

Then, once all the poses of the parts are known, you need to apply it to the model. First the model needs to be split in all the different body parts that you have, or at least, that you can get from the previous step. Then, render each piece with the proper transformation (its pose). To do that, well in openGL it would be with glRotatef() and glTranslatef() for the rotation and translation, respectively. For DX I have no idea, but it's most probably very similar.

That's the general procedure. The math of all this can pretty much be found anywhere on the internet, start with wikipedia, then mathworld, etc.

I hope I answer the question and that I didn't understand it wrong..

From the problem description is not clear - Do you want just move 3D model in space or animate different pose ? Ok, I make assumption that you want to animate pose, because you mention different body parts.
How to do that just google keywords "mesh deformation" and/or "skinning GPU".
Here is a crash tutorial how to do very simple mesh deformation on GPU-
http://www.ozone3d.net/tutorials/mesh_deformer.php
(skinning should be done on GPU with the help of vertex shaders because it should be more efficient)

Happy coding.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.