Sign in to follow this  

Picking 3D Models thats drawn with DrawIndexPrimitive

This topic is 1360 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 know how todo picking with LPD3DMESH objects but i am not sure how todo if for models directly drawn with DrawIndexPrimitve,how would you do it if D3DXIntersect takes a mesh object only?

Share this post


Link to post
Share on other sites

Multiple choices, some may be not suitable for you depending on what you are really doing:

a) Make a D3DX mesh from the vertex/index data. You can create an empty mesh with D3DXCreateMesh() and then lock and fill its vertex and index buffer.

b) Use D3DXIntersectTri() to do intersection tests on individual triangles rather than the whole mesh/subset.

c) Use some other intersection method :) Physics engines will probably have functions for this (Havok certainly does, I'm not sure about the others.)

Share this post


Link to post
Share on other sites
Sign in to follow this