Manipulating the Light and Texture of Triangles
We started drawing triangles back in Chapter 2, Let’s Start Drawing, and added lighting and texturing in Chapter 5, Let’s Light It Up! Now that we’ve covered normals in Chapter 10, Getting Acquainted with Lines, Rays, and Normals, it’s time to put it all together to take a look at how these special vectors are used to manipulate and affect the appearance of triangles.
Normals can belong to vertices and mesh faces. Besides being used to specify which side of a polygon should be rendered, they are also used to calculate how light falls across the surface of a polygon. In this chapter, we will begin by improving on the normal drawing technique discussed in Chapter 10, Getting Acquainted with Lines, Rays, and Normals, and use more vector calculations on triangles to find the center of a triangle and draw the normal from that point. This will allow you to draw normals on any mesh in your project, not just cubes...