I can’t understand the glNormal3f, I know that it works for ‘normalize’ the ‘normals’ of the vertex… Or something like that, but I can’t understand what is the ‘normal’ of the vertex.
Can you explain me that function? I can’t understand what ‘normal’ means in openGL…
I can’t understand the glNormal3f, I know that it works for ‘normalize’ the ‘normals’
Share
The “normal” of a vertex is the vector which is “perpendicular” to the vertex. In mathematics “normal” is a generalization of “perpendicular”. For a polygon, this “normal vector” is perpendicular to the polygon and is the same for all of its vertices. One reason you might assign different normal vectors to each vertex of a polygon is if you are covering a curved surface with very small triangles. In this case, you don’t want the normal vectors of the three vertices of the triangle to all be the same.
Now what is this normal vector used for? The typical application is used for coloring calculations when lighting is enabled in OpenGL. The normal vector can determine whether the light from a light source hits a surface and what angle a light ray makes with the surface. This can then be used to determine whether the surface is shadowed or contains a specular highlight, for instance.