Graphics Reference
In-Depth Information
cos 1 0
×
1
+
1
×
1
+
1
×
0
60
=
2 2
=
Using Eq. (2.11), we get
sin 1 3
sin 1
n
60
=
=
2 2
=
a
b
The preceding three equations are correct, as the triangle formed by a and b is an equilateral
triangle.
2.9.3 Surface normals
One important application of the vector product in computer graphics is its ability to compute
surface normals . Given a triangular mesh, we can use two sides of any triangle as the reference
vectors for the vector product. However, we must know the convention used for defining the
vertices of the triangle, and which side of the triangle faces outside or inside. Figure 2.24 shows
such a triangle where its vertices are defined in a counter-clockwise sequence as viewed from
the outside.
B
C
AB
AC
n
A
Figure 2.24.
Using our right hand, we can see that first vector has to be AB followed by AC, which ensures
that the surface normal n points in the direction from where we are viewing the triangle.
Given that the vertices are Ax A y A z A B x B y B z B , and C x C y C z C , then the vectors
AB and AC are defined as follows:
AB
=
x B
x A i
+
y B
y A j
+
z B
z A k
AC
=
x C
x A i
+
y C
y A j
+
z C
z A k
Therefore,
i
j
k
= AB
× AC
=
x B
x A
y B
y A
z B
z A
n
x C
x A
y C
y A
z C
z A
 
Search WWH ::




Custom Search