Weather (state,county)

Notification

6.2.13 The Right-Hand Rule
The right-hand rule is an aide m´emoire for working out the orientation of the cross product vector. Given the operation r × s, if the right-hand thumb is aligned with r, the first finger with s, and the middle finger points in the direction of t.
6.3 Deriving a Unit Normal Vector for a Triangle
Figure 6.11 shows a triangle with vertices defined in an anti-clockwise sequence from its visible side. This is the side we want the surface normal to point upwards. Using the following information we will compute the surface normal using the cross product and then convert it to a unit normal vector.
Create vector r between v1 and v3, and vector s between v2 and v3:


The unit vector tu can now be used in illumination calculations, and as it has unit length, dot product calculations are simplified.


6.4 Areas
Before we leave the cross product let’s investigate the physical meaning of
||r|| · ||s|| sin(β). Figure 6.12 shows two 2D vectors, r and s. The height h =
||s|| sin(β), therefore the area of the parallelogram is
||r||h = ||r|| · ||s|| sin(β) (6.32)
But this is the magnitude of the cross product vector t. Thus when we calculate
r×s, the length of the normal vector t equals the area of the parallelogram
formed by r and s. Which means that the triangle formed by halving the parallelogram
is half the area.
area of parallelogram = ||t|| (6.33)
area of triangle =
1
2
||t|| (6.34)
This means that it is a relatively easy exercise to calculate the surface area of an object constructed from triangles or parallelograms. In the case of a triangulated surface, we simply sum the magnitudes of the normals and halve the result.
------------------------------------------------------------------------------------------------------------------
6.4.1 Calculating 2D Areas
Figure 6.13 shows three vertices of a triangle P0(x0, y0), P1(x1, y1) and P2(x2, y2) formed in an anti-clockwise sequence. We can imagine that the triangle exists on the z = 0 plane, therefore the z-coordinates are zero.
 

Fig. 6.13. The area of the triangle formed by the vectors r and s is half the magnitude
of their cross product.
The vectors r and s are computed as follows:

                                                        

No comments