## Getting the Normal for a polygon.

Member
Posts: 23
Joined: 2006.12
Post: #1
A quick question, how can I get the normal for a polygon if all I have is the (x,y,z) for the 4 corners of said polygon? Any links that would explain the math behind this would also be appreciative.

Thanks!
Member
Posts: 156
Joined: 2002.10
Post: #2
First, you need to think about whether the 4-points of the polygon are coplanar (i.e. they lie in the same plane). If not, you can't define a single face normal for the polygon since it's not flat.

In general, 3 points in space can be used to define a plane, so pick three points on your plane (three of the vertices, call them A,B,C). Construct vectors AB and AC (any combinations will do). Take the vector cross product of AB & AC and you will get a vector that is normal (perpendicular) to the plane. Depending on your needs you may wish to normalise the vector by scaling it by 1/normal_length so it has unit magnitude.

Cheers

- Iain
Member
Posts: 23
Joined: 2006.12
Post: #3
Ah! That was just enough information to get it working! Thanks a ton.
Member
Posts: 51
Joined: 2009.02
Post: #4
It's not a polygon if the points aren't coplanar.