PDA

View Full Version : Maths stuff regarding Collision detection. (Polygons edge algorythm)

Anonymous Coward
10-13-2000, 12:15 PM
Im trying to implement some 'simple' collision detection code in a program and I found a problem.

Im currently testing for collision this way: Getting an edge of object 1and a point of object 2 to create a plane. Now, I have to know if this plane is separating the others points of obj1 and obj2 (obj1 points are on one side of the plane and obj2 points are on the other).

How can I do this? I tried finding the normal of the plane and then check for each vertex of each obj with a dot product. Is this correct?

Rob
10-13-2000, 01:15 PM
Not 100% sure I'm understanding the question. If you just want to know which side of the plane a point is on, get the plane in standard form (Ax+By+Cz+D = 0). Then plug in your x,y,z values for the vertices. if (Ax+By+Cz+D > 0) then you're "above" the plane. if (Ax+By+Cz+D < 0) then you're below it.

[This message has been edited by Rob (edited 10-13-2000).]