Plane Normals?

Started by
4 comments, last by SimDemon 21 years, 12 months ago
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
I'll have a link to the TriFaze website as soon as possible. It's still currently being designed, by myself of course! =) I'll update the URL and my signature as soon as possible.Feel free to send me a message on Yahoo! or AOL IM™. =)
Advertisement
It''s a simple cross product between 2 vectors in the plane.
Plane equation : Ax+By+Cz+D=0
Normal to the plane : (A,B,C)
I know that I don't know nothing... Operation Ivy
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
Oh yeah, remember that the normal''s direction follows the right-hand rule!
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( );

~CGameProgrammer( );Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.

This topic is closed to new replies.

Advertisement