Soldato
- Joined
- 9 Jun 2006
- Posts
- 2,642
Hi, would be much appreciated if someone could give me a hand with this. Well as part of my graphics coursework in OpenGL I need to find a way of calculating normals automatically. So before I do that, I need to understand how it is done on paper (i.e. if i worked it out myself).
So im told to find the direction that a face, is facing, I simply take two vectors in a counter-clockwise direction and that gives me the vector of the direction.
Sounds easy enough, but when I try it, it doesn't quite work. Lets use the rather crude picture below:
If i do the cross product of (1,0,0) and (1,1,0), I get the vector (0,0,1). Which says the face is facing down the z axis, when it should be facing down the x axis.
So where am I going wrong? I've been looking through a textbook to try and figure it out, but they decided not to include any examples. A google doesn't really shed much light on it.
Thanks in advance
EDIT: Ok so I've missed out the sin theta bit, but when I calculate that part, it returns something like 0.7 which seems like the wrong angle between the two edges to me.
So im told to find the direction that a face, is facing, I simply take two vectors in a counter-clockwise direction and that gives me the vector of the direction.
Sounds easy enough, but when I try it, it doesn't quite work. Lets use the rather crude picture below:

If i do the cross product of (1,0,0) and (1,1,0), I get the vector (0,0,1). Which says the face is facing down the z axis, when it should be facing down the x axis.
So where am I going wrong? I've been looking through a textbook to try and figure it out, but they decided not to include any examples. A google doesn't really shed much light on it.
Thanks in advance
EDIT: Ok so I've missed out the sin theta bit, but when I calculate that part, it returns something like 0.7 which seems like the wrong angle between the two edges to me.
Last edited: