•      Sign In
• Create Account

### #Actualcold_heats_.--.

Posted 27 August 2012 - 09:55 AM

Hello.
I am following WildBunny's tutorial regarding a simple physics engine :
http://www.wildbunny...es-for-dummies/
However, I have some trouble understanding this part :

"
for all particles i
{
for all planes j
{
distance = P[i].x*Planes[j].a + P[i].y*Planes[j].b + Planes[j].c;

if (distance < 0)
{
// collision responce
}
}
}
What this code is doing is finding, by projection, how much of the vector from the plane to the particle is in the direction of the plane normal."

If every particle is determined by its (x,y) point, isn't this a vector from the origin to that point ?

This line :
"distance = P[i].x*Planes[j].a + P[i].y*Planes[j].b + Planes[j].c"
doesnt actually compute the dot product of the origin-point vector and plane normal rather than the plane-point(vector) and normal dot-product?

I drew some sketches so you can see my point.I am testing a particle against the plane who's normal isnt normalized .
[Sorry, I actually mean dot-product , not cross ] .

I know there's a flaw in my reasoning, but I dont seem to get it .

### #2cold_heats_.--.

Posted 27 August 2012 - 09:53 AM

Hello.
I am following WildBunny's tutorial regarding a simple physics engine :
http://www.wildbunny...es-for-dummies/
However, I have some trouble understanding this part :

"
for all particles i
{
for all planes j
{
distance = P[i].x*Planes[j].a + P[i].y*Planes[j].b + Planes[j].c;

if (distance < 0)
{
// collision responce
}
}
}
What this code is doing is finding, by projection, how much of the vector from the plane to the particle is in the direction of the plane normal."

If every particle is determined by its (x,y) point, isn't this a vector from the origin to that point ?

This line :
"distance = P[i].x*Planes[j].a + P[i].y*Planes[j].b + Planes[j].c"
doesnt actually compute the dot product of the origin-point vector and plane normal rather than the plane-point(vector) and normal dot-product?

I drew some sketches so you can see my point.I am testing a particle against the plane who's normal isnt normalized .
[Sorry, I actually mean dot-product , not cross ] .

I know there's a flaw in my reasoning, but I dont seem to get it .

### #1cold_heats_.--.

Posted 27 August 2012 - 08:59 AM

Hello.
I am following WildBunny's tutorial regarding a simple physics engine :
http://www.wildbunny...es-for-dummies/
However, I have some trouble understanding this part :

"
for all particles i
{
for all planes j
{
distance = P[i].x*Planes[j].a + P[i].y*Planes[j].b + Planes[j].c;

if (distance < 0)
{
// collision responce
}
}
}
What this code is doing is finding, by projection, how much of the vector from the plane to the particle is in the direction of the plane normal."

If every particle is determined by its (x,y) point, isn't this a vector from the origin to that point ?

This line :
"distance = P[i].x*Planes[j].a + P[i].y*Planes[j].b + Planes[j].c"
doesnt actually compute the cross product of the origin-point vector and plane normal rather than the plane-point(vector) and normal cross-product?

I drew some sketches so you can see my point.I am testing a particle against the plane who's normal isnt normalized .

I know there's a flaw in my reasoning, but I dont seem to get it .

PARTNERS