Jump to content
  • Advertisement
Sign in to follow this  
lionelluo

directx & animation

This topic is 4712 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've a mouse and individual tooth modules in one 3DS file. How to do this in DirectX: Click on one of the teeth, and moving it out of gum. Please advice. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!