#### Archived

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

# Plane Normals?

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

## Recommended Posts

My question is: How do I calculate a plane''s normal. I found a site on vectors, and I am going to start on collision detection. If thispost = 0 Then GoBack() Else Read() End If

##### Share on other sites
It''s a simple cross product between 2 vectors in the plane.

##### Share on other sites
Plane equation : Ax+By+Cz+D=0
Normal to the plane : (A,B,C)

##### Share on other sites
Theory:

With 3 points that lies on the plane you can construct 2 vectors, with 2 vectors you just need to do cross product and that''s all.

Practice:

With points a, b, c you build 2 vectors:

vector1 = a - b
vector2 = c - b

normal.x = vector1.y * vector2.z - vector1.z * vector2.y;
normal.y = vector1.z * vector2.x - vector1.x * vector2.z;
normal.z = vector1.x * vector2.y - vector1.y * vector2.x;

and that''s all.

Bye

##### Share on other sites
Oh yeah, remember that the normal''s direction follows the right-hand rule!

##### Share on other sites
To clarify what Rambo said, by "points" he means "vectors"; to get the normal of a triangle, you''d use the three vertices of the triangle. Technically you could use any 3 points that lie along the plane of the triangle, but of course it''s simplest to use its vertices. Also note that the direction of the normal is relative to the order of the points - if they''re clockwise, the normal will point in the opposite direction than it would if they''re counterclockwise.

~CGameProgrammer( );

1. 1
2. 2
3. 3
4. 4
Rutin
13
5. 5

• 26
• 10
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633696
• Total Posts
3013397
×