#### Archived

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

# Which Technique for collision detection with terrain?

This topic is 5733 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I would like how you detect collision detection with a terrain and some other mesh like a human body, and why you do it that way. I can use a bounding sphere as a first test with the object mesh and then subdivide to make it accurate but what should I do about the terrain? Test against each triangle inside the bounding sphere? As usual any comment of any kind, except flames that don't help are apreciated ;D [edited by - Coz on March 30, 2003 9:35:45 PM]

##### Share on other sites
I just use the heightmap to figure out the height of the terrain at that particular point. For spaces between vertices, I simply interpolate. If an object was on one side the previous frame and is somehow on the other side the next frame, a collision is assumed to have occured.

##### Share on other sites
But what if I don''t use a heightmap? also, the terrain is not big; the biggest extension I would ever need would be about the size of the hyrule field in Zelda OOT.

---------------------->
Nothing in the world is the way it should be; that''s why we, the champions, exist and live for: HOPE.

##### Share on other sites
The simplest way is certainly to test each face against your collision volume. Use some sort of hierarchy (octree, quadtree etc.) to cut down the number of triangles tested.

##### Share on other sites
Thanks ;D
Now that I think abou it I might have put this in the Math and Physics forum, even tought I'm using OpenGL because I tought that the answer would have some thing to do with it... and now that I think about that also, why would it have something to do with it?

---------------------->
Nothing in the world is the way it should be; that's why we, the champions, exist and live for: HOPE.

[edited by - Coz on April 1, 2003 12:57:53 PM]

##### Share on other sites
Ah. . . sorry. . . I was having trouble thinking yesterday. Damn cold. . .

Don''t worry :D
Any other ideas?

1. 1
2. 2
3. 3
Rutin
14
4. 4
5. 5

• 9
• 9
• 11
• 11
• 23
• ### Forum Statistics

• Total Topics
633674
• Total Posts
3013275
×