Page 358 (Yahoo free web hosting) OpenGL Super Bible! glMaterial Purpose Sets

Page 358 OpenGL Super Bible! glMaterial Purpose Sets material parameters for use by the lighting model. Include File Variations void glMaterialf(GLenum face, GLenum pname, GLfloat param); void glMateriali(GLenum face,GLenum pname,GLint param); void glMaterialfv(GLenum face, GLenum pname, const GLfloat *params) void glMaterialiv(GLenum face, GLenum pname, const GLint *params); Description This function is used to set the material reflectance properties of polygons. The GL_AMBIENT, GL_DIFFUSE, and GL_SPECULAR properties affect how these components of incident light are reflected. GL_EMISSION is used for materials that appear to give off their own light. GL_SHININESS can vary from 0 to 128, with the higher values producing a larger specular highlight on the material surface. Finally, GL_COLOR_INDEXES is used for material reflectance properties in color Index mode. Parameters face GLenum: Specifies whether the front, back, or both material properties of the polygons are being set by this function. May be either GL_FRONT, GL_BACK, or GL_FRONT_AND_BACK. pname GLenum: For the first two variations, this specifies the single-valued material parameter being set. Currently, the only single-valued material parameter is GL_SHININESS. The second two variations, which take arrays for their parameters, may set the following material properties: GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, GL_EMISSION, GL_SHININESS, GL_AMBIENT_AND_DIFFUSE, or GL_COLOR_INDEXES. param GLfloat or GLint: Specifies the value to which the parameter specified by pname (GL_SHININESS) will be set. params GLfloat* or GLint*: An array of floats or integers that contain the components of the property being set. Returns None. Example See the LITJET sample program from this chapter. See Also glGetMaterial, glColorMaterial, glLight, glLightModel
Visit our web design programs services for an affordable and reliable webhost to suit all your needs.

Leave a Reply