Skip to main content
gamedev.net
🔒 Locked

Collision Help

Started by Saqib 1 reply 300+ views
Original Post
Saqib
Saqib
I have done a very basic collision detection code in NeHe''s Lesson 23 which works like this: First i find the normal to the walls. Plane equation = Ax + By + Cz + d; Then i find the distance between the camera and the walls by dist=normal.DotProduct - d; but when i try to do the collision detection i face a problem. I have done the coll det such that when the dist is zero the object has touched a wall and must stop. But my camera stops half the way. Its like there are hidden walls between the distance. Plz help me out. And if you can tell me of a site which provides basic collision detection code. Saqib
manutd
manutd
I think what is happening is the camera is stoping in the middle of the wall...
what you''ll have to do (I think) is increase the stopping value from 0 to a higher value so that it will stop a little before the wall but it will not see through it....
I hope this is correct

Is pork a noun or a verb?

Jamie
Nate
Nate
If you are just checking planes for a collision you are doing it incorrectly. Simply checking a points distance to the plane will not work out since planes are infinite. If your path intersects a plane you then have to test to see if that path is indeed inside of a face. Merly checking planes won''t work since you will probably intersect planes for other faces in the world that are no where near your position. Try going here and getting the document on collision detection to clear things up : http://www.graphicspapers.com/search.cgi?criteria=&op=show&tfile=docs&img=docs

Nate Miller
http://nate.scuzzy.net

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.