Jump to content
  • Advertisement


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


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

This topic is 5825 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

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

google, first hit..

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

"take a look around" - limp bizkit

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!