Sign in to follow this  
lionelluo

directx & animation

Recommended Posts

This involves several things. First, you must load the meshes. If you have more than one frame or bone in the .x file, you'll need to use the D3DXLoadMeshHierarchyFromX function. There are some examples in the SDK for this, and plentiful ones on google. I'm pretty sure this site has some under the Articles section at the top. The D3DXLoadMeshFromX function will combine everything in the .x file into one mesh, so that won't work for you probably, since you want to treat each tooth as a separate entity.

The second thing you need to understand is how to convert 2D mouse clicks into 3D space. This is called Ray Picking. Take a look at the Pick example in the SDK. There are also lots of tutorials on that on the net.

Lastly, you'll move the meshes around by one of two ways. Either set the world transformation matrix and render the mesh, or modify each vertex position in the mesh. Since you aren't time-critical, I'd do it this way. It makes collision easier.

Share this post


Link to post
Share on other sites
Thanks Chris

>>so that won't work for you probably, since you want to treat each tooth as a separate entity.

Any sample for this? if I load each tooth and the mouth separate, how to position them? for the gum, have lots holes for the teeth.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this