collision detection

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?

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

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 || 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

http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=30

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 :smiley:

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.

Originally posted by Andrew Waller:
[b]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?[/b]

how can i download and install opengl language on my pc??
thanks alot

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 .

what would be the advantage of using a bsp tree over just using planes and vectors