Page 356 OpenGL Super Bible! glLightModel Purpose Sets

Page 356 OpenGL Super Bible! glLightModel Purpose Sets the lighting model parameters used by OpenGL. Include File Variations void glLightModelf(GLenum pname, GLfloat param) void glLightModeli(GLenum pname, GLint param); void glLightModelfv(GLenum pname, const GLfloat *params); void glLightModeliv(GLenum pname, const GLint *params); Description This function is used to set the lighting model parameters used by OpenGL. Any or all of three lighting model parameters may be set. GL_LIGHT_MODEL_AMBIENT is used to set a default ambient illumination for a scene. By default, this light has an RGBA value of (0.2, 0.2, 0.2, 1.0). Only the last two variations may be used to set this lighting model because they take pointers to an array that can contain the RGBA values. The GL_LIGHT_MODEL_TWO_SIDE parameter is specified to indicate whether both sides of polygons are illuminated. By default, only the front (defined by winding) of polygons is illuminated, using the front material properties as specified by glMaterial(). Finally, specifying a lighting model parameter of GL_LIGHT_MODEL_LOCAL_VIEWER modifies calculation of specular reflection angles, whether the view is down along the z axis or from the origin of the eye coordinate system (see Chapter 6). Parameters pname GLenum: Specifies a lighting model parameter. GL_LIGHT_MODEL_AMBIENT, GL_LIGHT_MODEL_LOCAL_VIEWER, and GL_LIGHT_MODEL_TWO_SIDE are accepted. param GLfloat or GLint: For GL_LIGHT_MODEL_LOCAL_VIEWER, a value of 0.0 indicates that specular lighting angles take the view direction to be parallel to and in the direction of the z axis. Any other value indicates that the view is from the origin of eye coordinate system. For GL_LIGHT_MODEL_TWO_SIDE, a value of 0.0 indicates that only the fronts of polygons are to be included in illumination calculations. Any other value indicates that both the front and back are included. This parameter has no effect on points, lines, or bitmaps. params GLfloat* or GLint*: For GL_LIGHT_MODEL_AMBIENT or GL_LIGHT_MODEL_LOCAL_VIEWER this points to an array of integers or floating point values, only the first element of which is used to set the parameter
If you are looking for affordable and reliable webhost to host and run your business application visit our ftp web hosting services.

Leave a Reply