collision detection w/ .X models

Started by
2 comments, last by MetaKnight 17 years, 4 months ago
Hi all, I'm pretty new to DirectX, and was hoping someone could point me towards a nice demo/tutorial that covers collision detection against a .X model? Thanks
Advertisement
For any kind of model you would most likely use an axis-aligned bounding box and test it against other models (and their bounding boxes) as well as testing it against the world (in whichever format you use)

http://www.gamasutra.com/features/20000203/lander_01.htm

http://www.toymaker.info/Games/html/collisions.html

http://www.flipcode.com/articles/dpcolumn_issue05.shtml

http://www.3dkingdoms.com/weekly/weekly.php?a=3

http://www.harveycartel.org/metanet/tutorials/tutorialA.html

http://www.devmaster.net/articles/quake3collision/

check those out,
Thanks, but for what I'm looking to do, I think I need to test every triangle or at least every poly or surface. I'm not certain of the intricacies of the X format and was hoping a good demo/tutorial could help me better understand how to navigate through an X model using the utils libraries that Microsoft provides.

I’m considering using X models for buildings and larger vehicles, so I’d actually be standing inside a model and need to know when I hit a wall or an opening to another room or even to exit/enter the building.


Just to let you know triangle collision detetion is expensive and what you do have to do is to make a make your own collision solution where you test bounding box first and then make the triangle test if that passes.

But there's lots of free Collision SDKs that work triangles, for example
Tokamak has a static triangle mesh object that you can use.

Here's the tutorial on how to make a terrain mesh for Tokamak
http://www.adamdawes.com/programming/tokamak/04_TerrainMesh.html



You can get vertex and index data from a X-file, using LockIndexBuffer and use the terrain mesh solution above.

This topic is closed to new replies.

Advertisement