This topic is now archived and is closed to further replies.


3D Collision Detection .x File Mesh objects as levels..

Recommended Posts

Ok, so far I have been trying to come up with a simpel way to detect if the camera in my 3d game using directx collides with the terrain ect, I know how to detect a collsion in terms of a simple cube or box, collidies with the camera but now im having problems with the actual mesh itself. I so far have made a bounding box to my level mesh that is being used as a restraint to keep the user from leaving the level area obviously. The problem is my level's mesh is not a square-like shape infact its complex hilly terrain, and I need to find a way to detect collsions. I know I could probably use a simple height map but I don't really want that. I want to beable to use my mesh and change it without having to recreate a new height map every time. I found lots of articles on octtrees, bsp trees and aabb trees but these speak of how to divide the object into sections to determain where to detect collsions. I haven't been able to figure out how to detect collsions with my camera and individual polygons throughout the mesh, and that is where my problem lies so if anyone has any help it would be great. I know the mesh is a vertex buffer I know to lock the vertex buffer you can read the data but I dont know how to read the data Ive made my own vbs and manipulated them but sense I made them I obviously had the data required to make each vertex but how do I read one from a .x file and understand what is what and use that to my advantage if anyone can show me not how to manipulate one or make one but how to acutally read the contents of a vertex buffer from a .x file mesh loaded into the scene it would be great. [edited by - DevLiquidKnight on March 22, 2004 7:05:06 PM]

Share this post

Link to post
Share on other sites