• Advertisement
Sign in to follow this  

Collision Detection and .X files

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

Hy everybody! How can I do the Collision Detection in case of X files? How can I access to the vertices? Is there a good Collision detection library in the D3DX, I couldn't see. THX!

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by CastorX
Hy everybody!
How can I do the Collision Detection in case of X files?

X files describe models - collision detection techniques are relatively independent of the model format used. You typically use bounding volumes (spheres, cylinders, boxes, ellipsoids, etc). With D3DX, you can use the utility functions D3DXComputeBoundingBox and/or D3DXComputeBoundingSphere to get your bounding volumes. There is a number of articles on collision detection and response on GameDev.net. Also, peroxide have a tutorial here. You can head to either the "Math and Physics" forum or the "Game Programming" forum for more details on the math behind it, and implementation strategies, respectively.

Quote:
How can I access to the vertices?

In the documentation page titled "ID3DXMesh Interface", you can clearly see a function named ID3DXMesh::LockVertexBuffer. It does what it says it does.

Quote:
Is there a good Collision detection library in the D3DX, I couldn't see.

There is a precise ray-mesh intersection detection functionality. D3DXIntersect. But it goes down to the triangle level, and is only advisable if:
a) You know that the ray most probably intersects the mesh (via a ray-bounding volume check)
b) You want triangle-precision collision detection.

There are a number of freely available collision detection libraries, by the way. e.g. COLDET.

Share this post


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

  • Advertisement