OpenGL Super Bible! (Com web hosting) Page 317 Figure 9-9 Light

OpenGL Super Bible! Page 317 Figure 9-9 Light is reflected off objects at specific angles From a programming standpoint, this presents a slight conceptual difficulty. Each polygon is created as a set of vertices, which are nothing more than points. Each vertex is then struck by a ray of light at some angle. How then do you (or OpenGL) calculate the angle between a point and a line (the ray of light)? Of course you can t geometrically find the angle between a single point and a line in 3D space, because there are an infinite number of possibilities. Therefore, you must associate with each vertex some piece of information that denotes a direction upward from the vertex and away from the surface of the primitive. Surface Normals A line from the vertex in this upward direction would then start in some imaginary plane (or your polygon) at a right angle. This line is called a normal vector. That word vector may sound like something the Star Trek crew members toss around, but it just means a line perpendicular to a real or imaginary surface. A vector is a line pointed in some direction, and the word normal is just another way for eggheads to say perpendicular (intersecting at a 90 angle). As if the word perpendicular weren t bad enough! Therefore, a normal vector is a line pointed in a direction that is at a 90 angle to the surface of your polygon. Figure 9-10 presents examples of 2D and 3D normal vectors. Figure 9-10 A 2D and a 3D normal vector
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision J2ee Web Hosting services.

Leave a Reply