Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I read couple articels about collisions and terrain but there is nothing about terrain making in 3D program I can't see boundingBox being used for terrain collision there must be something like Every Single trinangle collision tell me if i wrong and give me some tips

share|improve this question

1 Answer 1

It depends on what kind of terrain you have. Normally, terrain is stored as a grid of height values, which eliminates the possibility of having caves, overhangs, or vertical cliffs. This terrain is usually stored as a height map, which is an image that contains the height data, instead of as a model. Collision detection on a heightmap is usually done by calculating the height (Y) at a certain position (XZ) using interpolation and comparing that to the height of an object or point.

If your terrain is just another model, you'll have to decompose it into a series of convex hulls and use a 3D collision algorithm like Minkowski subtraction or the separating-axis theorem, exactly the same way you would handle any other 3D collisions. For simpler games with only basic collision detection needs, I'm sure you can get away with raycasting, which is a relatively simple operation, to check for collisions in a given direction.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.