Am writing a function to detect particle collision on a given plane, with the help of the normal of each point on the plane. I wanted to know how i can calculate the normal for each point on the plane.

And how do i generate every single point on that plane with the above co-ordinates, as i need to substitute it in the given formula. (X-P).N, given X the position of the particle, P the position of a point on the plane and N the normal.

Take the cross product of two linear independent vectors in the plane.
If p0, p1, p2, p3 are the points you use to visualize the plane, two suitable vectors are p1-p0 and p2-p0.

If i cannot generate the points, how do i use the above formula for calculating a collision since i need to process the point on the plane, or would it be the same if the value of P in the formula (X-P).N be equal to the same vector value, say the center, (0,-6.5,0)??

Please use [ code]/[ /code] (without space after ‘[’) around code snippets, also please read the forum posting guidelines.

The code looks like it should do the right thing, but why does it not make use of tVector3 for Q, P and N? Do you have some functions/user defined operators that compute difference, cross product, length of a tVector3 that would make this easier/more readable? If not, why not?

This does all look awfully like a homework assignment…

A particle collides with the plane if it’s movement for the current time step takes it from one side of the plane to the other. In other words if it is on one side in this time step and would be on the other side in the next time step.
So in order to detect collisions you need to test which side of a plane the particle is on.

Just for my sake i have done it that way, i find it easier to manipulate the data like that. How do i find out which side of the plane the particle is on??

Yes this is an assignment its the last part of my physics project, so for sake of quickness could you please tell me how you would do it, in code or pseudo code.

Yes this is an assignment its the last part of my physics project, so for sake of quickness could you please tell me how you would do it, in code or pseudo code.

Not really, I just needed a little bit of help, a push you might say. Am sure when you were in your earlier stages you needed someone to help. So don’t put your two penny’s worth if you are not interested in doing a deed, if so move alone pal, nobody wants to listen to your self righteous crap. You don’t even know me, so why would would you give a ****.

Anyway, i figured it out coz guess what you may have experience, but i got the brains. Shove it where it don’t shine.

I have not gone through all posts, but I guess you are using a normal form of euation for a plane i.e dot(N,p) + k = 0

So you can use your point, under consideration and plug in above formula to check whether point touches plane or not ( if right hand side is 0 => point touches), if right hand side is < 0 it means point is on opposite direction to plan normal and vice -versa.