OpenGL Super Bible! Page 331 Figure 9-18 Jagged

OpenGL Super Bible! Page 331 Figure 9-18 Jagged surface with the usual surface normals Although the normals are shown in between the corners, they are actually specified for each vertex. If you take into account that each vertex actually boarders another surface, you can specify the normal for that vertex as the average of the two normals at that point for each surface. Figure 9-19 shows that for two adjoining surfaces, their common corner would have a different normal specified as each surface is drawn. If we take the average of these two normals and use it when we specify each surface, the joining of the two surfaces will appear less sharp after OpenGL does its surface shading. Figure 9-19 Averaging the normals will make sharp corners appear softer Listing 9-7 shows the rendering function that creates the surface shown in Figure 9-18. (This code is from the example program WAVEY in the CD subdirectory for this chapter.) The surface is created by stepping from left to right for the x coordinates, and alternating up and down in the y coordinate direction. The z coordinates are constant, with 50 being the front of the image and 50 being at the back.
From our experience, we can recommend PHP Web Hosting services, if you need affordable webhost to host and run your web application.

Leave a Reply