glut/progs/examples/screendoor.c
/* Initialize material property and light source. */
Initialize material property and light source.
Initialize material property and light source .
void
myinit(void)
{
  GLfloat light_ambient[] =
  {0.2, 0.2, 0.2, 1.0};
  GLfloat light_diffuse[] =
  {1.0, 1.0, 1.0, 1.0};
  GLfloat light_specular[] =
  {1.0, 1.0, 1.0, 1.0};
  GLfloat light_position[] =
  {1.0, 1.0, 1.0, 0.0};
  glClearColor(0.49, 0.62, 0.75, 0.0);
  glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient);
  glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse);
  glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular);
  glLightfv(GL_LIGHT0, GL_POSITION, light_position);
  glEnable(GL_LIGHT0);
  glDepthFunc(GL_LESS);
  glEnable(GL_DEPTH_TEST);
  glEnable(GL_LIGHTING);
  glEnable(GL_CULL_FACE);
  glEnable(GL_POLYGON_STIPPLE);
  glNewList(TORUS, GL_COMPILE);
  glutSolidTorus(0.275, 0.85, 10, 15);
  glEndList();
  glNewList(TETRAHEDRON, GL_COMPILE);
  glutSolidTetrahedron();
  glEndList();
  glNewList(ICOSAHEDRON, GL_COMPILE);
  glutSolidIcosahedron();
  glEndList();
}
void myinit ( void ) { GLfloat light_ambient [ ] = { 0.2 , 0.2 , 0.2 , 1.0 } ; GLfloat light_diffuse [ ] = { 1.0 , 1.0 , 1.0 , 1.0 } ; GLfloat light_specular [ ] = { 1.0 , 1.0 , 1.0 , 1.0 } ; GLfloat light_position [ ] = { 1.0 , 1.0 , 1.0 , 0.0 } ; glClearColor ( 0.49 , 0.62 , 0.75 , 0.0 ) ; glLightfv ( GL_LIGHT0 , GL_AMBIENT , light_ambient ) ; glLightfv ( GL_LIGHT0 , GL_DIFFUSE , light_diffuse ) ; glLightfv ( GL_LIGHT0 , GL_SPECULAR , light_specular ) ; glLightfv ( GL_LIGHT0 , GL_POSITION , light_position ) ; glEnable ( GL_LIGHT0 ) ; glDepthFunc ( GL_LESS ) ; glEnable ( GL_DEPTH_TEST ) ; glEnable ( GL_LIGHTING ) ; glEnable ( GL_CULL_FACE ) ; glEnable ( GL_POLYGON_STIPPLE ) ; glNewList ( TORUS , GL_COMPILE ) ; glutSolidTorus ( 0.275 , 0.85 , 10 , 15 ) ; glEndList ( ) ; glNewList ( TETRAHEDRON , GL_COMPILE ) ; glutSolidTetrahedron ( ) ; glEndList ( ) ; glNewList ( ICOSAHEDRON , GL_COMPILE ) ; glutSolidIcosahedron ( ) ; glEndList ( ) ; }
Initialize material property and light source.
Initialize material property and light source .