Jump to content
  • Advertisement
Sign in to follow this  
TheQuixotiC

Picking on Animated Meshes

This topic is 4931 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

How can I get the mesh from skinned mesh to use in D3DXIntersect method ? or How can I pick the model loaded with D3DXLoadMeshHierarchyFromX? If you have any sample about this,Please do not hesitate to write :) I need your help. Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
neneboricua19 seems to have some kind of advanced inverse ray system that works. The only way I know to correctly cast a ray into a skinned mesh is to pose the vertices in system memory and do it the normal way.

In my game, I use static meshes posed with the bones to do this and sphere collision. It's not totally accurate around seams, but it's extremely fast. With static meshes, you can definitely use the inverse ray technique.

Share this post


Link to post
Share on other sites
What I was refferring to in that other thread was that if you want to do *exact* picking on a skinned mesh, you pretty much have to perform software skinning on the vertices. That is not very efficient. So a better way to do it would be to have a hierarchy of bounding volumes for the mesh.

Depending on what kind of mesh you're dealing with, you can choose the bounding volume to use. For a humanoid mesh, I think the best choice would be an Object Oriented Bounding Box. Each of the major parts of the mesh could have a bounding box on it: head, arms, legs, and torso. You perform your picking against these 6 bounding boxes instead of the whole mesh.

Since the mesh is skinned, you have to transform these bounding boxes by the matrices that effect the joints of each major body part. So for the head, you need create a matrix that is a combination of the skinning matrices that affect how the head moves around. This matrix is what transforms your bounding box into model space. Concatenate this matrix with the world space matrix for the mesh and then take the inverse of this new matrix. The resulting inverse matrix is what you use to transform your picking ray. You can then use this ray to perform an intersection test against your bounding box.

I can't really give you code to do this because it is not trivial. You may be using a different model format and it is up to you (or really your artist) to decide which vertices affect the major parts of the mesh so that you know which skinning matrices look at when transforming your bounding volume. I've never seen a tutorial or sample application that implements picking on skinned meshes because of the amount of work involved.

Perhaps there are more "hacky" ways of doing it that may be a bit less accuracte but simpler to implement.

neneboricua

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!