Jump to content
  • Advertisement

Archived

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

phaelax

normal of a plane

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

Advertisement
Pick three.

Form two vectors:

V1 = P2 - P1
V2 = P3 - P1

The normal is the cross product of the vectors:

N = V1 X V2

(normalized is usually most useful)

If you know something about the points which will give you a particular ''sidedness'' to the plane then you may want the negation of the cross product above.

Share this post


Link to post
Share on other sites
I assume that when you look at the polygon from the front, your verts go counter clockwise. Subsequently you have at least 3 verts (even if you have more than 3 verts, you ignore the rest) v0,v1, and v2. To calculate the normal:

Vector1 = v1 - v0;
Vector1.Normalize();

Vector2 = v2 - v0;
Vector2.Normalize();

//Crossproduct(hand,palm) returns the direction of ''thumb''
Normal = CrossProduct(Vector1,Vector2);

Normal.Normalize(); //The length of the normal is ||Vector1|| * ||Vector2|| * sine of the angle between the two

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!