• Advertisement

Archived

This topic is now archived and is closed to further replies.

Filling in the plane equation (Ax+By+Cz+D=0)

This topic is 5709 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How would I go about filling in the plane equation (Ax+By+Cz+D=0)? I am going to use it for collision detection, but I haven''t figured out how to fill in the equation as you can probably tell. Anyhow, please help me! If thispost = 0 Then GoBack() Else Read() End If

Share this post


Link to post
Share on other sites
Advertisement
Hi

the vector (A,B,C) is the ''normalized normal'' of the plane. D is the distance from the plane to the origin.
So the usual practice is to just hold the normal and D in a plane struct/class. Filling it in goes then like this:


  
void Plane::FromPoints ( Vector v1, Vector v2, Vector v3 )
{
Vector d1, d2;
d1 = v2 - v1;
d2 = v3 - v1;
normal = CrossProduct ( d2, d1 );
normal.Normalize ();
D = -(normal.x*v1.x + normal.y*v1.y + normal.z*v1.z);
}


where v1, v2 and v3 are three arbitrary points on the plane





Runicsoft -- home of my open source Function Parser and more

Share this post


Link to post
Share on other sites
Don''t think it has to be normalized (A,B,C). You may want it normalized for other reasons though

Share this post


Link to post
Share on other sites
http://astronomy.swin.edu.au/~pbourke/geometry/planeeq/

google, first hit..

google("Plane Equation Ax+By+Cz+D=0");

"take a look around" - limp bizkit
www.google.com

Share this post


Link to post
Share on other sites

  • Advertisement