PDA

View Full Version : collision detection



Andrew Waller
12-28-2005, 12:10 PM
hi need some help with collision detection

Using a cube i have a character moving around the cube but I want to implement collision detection for when it reaches the boundry of the cube.

Anybody know how to do this?

UrbanLegend
12-28-2005, 12:43 PM
HI

Try a search of this site and forum or even a straight google, as collision detection has been discussed many many times from simple to advanced

iris_raj
12-28-2005, 11:13 PM
Dear,

The following solution might be some use.

construct an Axis Aligned Bounding Box around your charcter (There are many sites where you can find algorithms for constructing an AABB for a given primitive and then check for collision between the cube and AABB of character by comparing their extremas. Algorithm is given below

Check_intersection (box & A, box &B)
{
if(A.max < B.min &#0124;&#0124; A.min > B.max )
{
printf(“No Collisionn”);

}
else
{
printf(“Collision”);

}
}

Collision Response is depends exclusively on your requriement.

Hope this helps

Rajesh.R
IRIS,CAIR, Bangalore
rajeshr@cair.res.in

UrbanLegend
12-29-2005, 04:12 AM
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=30

ChiefWiggum
12-30-2005, 05:30 AM
Collision detection isnt a gl issue really... It'd be better if you searched on places like gamedev/flipcode where they have more general areas devoted to things like game issues, sound, AI, etc, you should be able find more specific info there :D

Edit: If you're hoping to do something more global, like a quake-style 3D walkthrough, I'd suggest looking up info about BSP trees and collision with planes, brushes.

blondin
12-30-2005, 06:09 AM
Originally posted by Andrew Waller:
hi need some help with collision detection

Using a cube i have a character moving around the cube but I want to implement collision detection for when it reaches the boundry of the cube.

Anybody know how to do this?

blondin
12-30-2005, 06:12 AM
how can i download and install opengl language on my pc??
thanks alot

UrbanLegend
12-30-2005, 06:26 AM
blondin

What has your question got to do with Collision detection ?

Please do not Hi-jack a thread like this, , simply create a New thread instead .

Andrew Waller
12-30-2005, 03:20 PM
what would be the advantage of using a bsp tree over just using planes and vectors