Collision Detection
Hello everyone,
I am trying to do collision detection, I am thinking to do bounding box collision, however, I am not sure how to set bounding volume for my camera? Do I just Draw a box around it, for example? How do i do that?
THanks alot
I am trying to do collision detection, I am thinking to do bounding box collision, however, I am not sure how to set bounding volume for my camera? Do I just Draw a box around it, for example? How do i do that?
THanks alot
If you make a box around the camera position and test is for collision with other bounding boxes that will tell you if the camera is nearish a bounding box.
Sir, e^iÏ€ + 1 = 0, hence God exists; reply!
For the camera using a sphere may give you smoother results and is easier to implement.
Unless you wanted to detect collision with it and a box, which would be harder to implement.
Sir, e^iÏ€ + 1 = 0, hence God exists; reply!
In that case you will need quite a bit of math.
the basics would be point plane intersection, and point face intersection.
this site has lots of articles about the subject
Gamasutra
A chapter from the book "Graphics Gems II" Ray Triangle Intersection Using Binary Recursive Subdivision help me a lot when I was trying to do CD and .
most of my collision stuff is based on this article
Advanced Character Physics even though the title may sound intimidating the core of all this stuff (Verlet integration scheme) is one of the easiest ways to handle stable collision detection.
sorry but there's no easy answer for your question.
the basics would be point plane intersection, and point face intersection.
this site has lots of articles about the subject
Gamasutra
A chapter from the book "Graphics Gems II" Ray Triangle Intersection Using Binary Recursive Subdivision help me a lot when I was trying to do CD and .
most of my collision stuff is based on this article
Advanced Character Physics even though the title may sound intimidating the core of all this stuff (Verlet integration scheme) is one of the easiest ways to handle stable collision detection.
sorry but there's no easy answer for your question.
There is, use boxbox collision.
Sir, e^iÏ€ + 1 = 0, hence God exists; reply!
The type of collision detection to use depends on a whole lot of factors:
how accurate you want it to be, how much math you can handle, how you intend to respond to the detection...etc...
What type of game are you making? is this only for the camera?
how accurate you want it to be, how much math you can handle, how you intend to respond to the detection...etc...
What type of game are you making? is this only for the camera?
There was a long silence...
'I claim them all,' said the Savage at last.
How much math do you want to do? I just got done getting planes of arbitrary boundaries to collide, and here's a walkthrough of what I did. If you're interested, I can also post more specific info:
I figure that in order for 2 planes to collide, at least one boundary line of one plane must collide with the other plane. What I do is I take each bounding line of each plane and break it into a parametric equation. I plug that into the plane equation of the other plane and check the point of where it collides. A collision occurred if point is within the line's boundary (with the way I implemented it, basically if the value of t is between 0 and 1) and the point is within boundary of the other plane (basically you check the rays between the vertices and the points, add the angles between each of the consecutive rays, and if it reaches 2*pi radians (or 360Â°) it's inside the boundaries) With this method it is necessary to check first the one plane against the second, then the second against the first one. It's possible to speed things up by doing things such as seeing if the point is within the boundaries of the line, then only plug it into the plane equation if it is.
If you have no idea about how to do any of these things (such as create a plane equation or a parametric line equation), I suggest you either find a library that does this or just use spherical collisions. If this is only for the camera, I'd suggest just using spherical collision, but if this is for other things as well, it would probably be worth your time to work it out.
I figure that in order for 2 planes to collide, at least one boundary line of one plane must collide with the other plane. What I do is I take each bounding line of each plane and break it into a parametric equation. I plug that into the plane equation of the other plane and check the point of where it collides. A collision occurred if point is within the line's boundary (with the way I implemented it, basically if the value of t is between 0 and 1) and the point is within boundary of the other plane (basically you check the rays between the vertices and the points, add the angles between each of the consecutive rays, and if it reaches 2*pi radians (or 360Â°) it's inside the boundaries) With this method it is necessary to check first the one plane against the second, then the second against the first one. It's possible to speed things up by doing things such as seeing if the point is within the boundaries of the line, then only plug it into the plane equation if it is.
If you have no idea about how to do any of these things (such as create a plane equation or a parametric line equation), I suggest you either find a library that does this or just use spherical collisions. If this is only for the camera, I'd suggest just using spherical collision, but if this is for other things as well, it would probably be worth your time to work it out.
Possibly Related Threads...
Thread:  Author  Replies:  Views:  Last Post  
Optimize the collision detection  alaslipknot  1  3,283 
May 12, 2013 08:02 PM Last Post: SethWillits 

Collision detection tutorial  ThemsAllTook  7  23,444 
Nov 5, 2011 05:20 PM Last Post: SethWillits 

Help with Collision Detection..(i'm almost there)  carmine  1  4,904 
Jun 29, 2011 12:33 PM Last Post: ThemsAllTook 

Time Delta, collision detection  mk12  19  16,385 
Sep 8, 2010 06:40 PM Last Post: AnotherJake 

Collision detection for pinball game  johncmurphy  0  4,961 
Sep 6, 2009 02:46 PM Last Post: johncmurphy 