home *** CD-ROM | disk | FTP | other *** search
- void MyMaterial(GLenum mode,GLfloat *f,GLfloat alpha)
- {
- GLfloat d[4];
- d[0]=f[0];
- d[1]=f[1];
- d[2]=f[2];
- d[3]=alpha;
- glMaterialfv (GL_FRONT_AND_BACK,mode,d);
- }
- /*
- * SelectMaterial uses OpenGL commands to define facet colors.
- *
- * Returns:
- * Nothing
- */
-
- void SelectMaterial(int i)
- {
- //
- // Define the reflective properties of the 3D Object faces.
- //
- glEnd();
- GLfloat alpha=materials[i].alpha;
- MyMaterial (GL_AMBIENT, materials[i].ambient,alpha);
- MyMaterial (GL_DIFFUSE, materials[i].diffuse,alpha);
- MyMaterial (GL_SPECULAR, materials[i].specular,alpha);
- MyMaterial (GL_EMISSION, materials[i].emission,alpha);
- glMaterialf (GL_FRONT_AND_BACK,GL_SHININESS,materials[i].phExp);
-