Beispiel #1
0
void
init(void)
{
    gltbInit(GLUT_LEFT_BUTTON);
  
    /* read in the model */
    model = glmReadOBJ(model_file);
    scale = glmUnitize(model);
    glmFacetNormals(model);
    glmVertexNormals(model, smoothing_angle);

    if (model->nummaterials > 0)
	material_mode = 2;

    /* create new display lists */
    lists();

    glEnable(GL_LIGHTING);
    glEnable(GL_LIGHT0);
    glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);

    glEnable(GL_DEPTH_TEST);

    glEnable(GL_CULL_FACE);
}
Beispiel #2
0
void
init(void)
{
    
    renderShaderID = loadShaders("shaders/vShader.c", "shaders/fShader.c");
    shadowShaderID = loadShaders("shaders/shadowVShader.c", "shaders/shadowFShader.c");
    
    //initShadowMap();
    
    gltbInit(GLUT_LEFT_BUTTON);
    
    /* read in the model */
    model = glmReadOBJ(model_file);
    scale = glmUnitize(model);
    glmFacetNormals(model);
    glmVertexNormals(model, smoothing_angle);
    
    if (model->nummaterials > 0)
        material_mode = 2;
    
    /* create new display lists */
    lists();
    
    glEnable(GL_LIGHTING);
    glEnable(GL_LIGHT0);
    glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
    
    //glEnable(GL_DEPTH_TEST);
    
    //glEnable(GL_CULL_FACE);
}
Beispiel #3
0
void
init(void)
{
  gltbInit(GLUT_LEFT_BUTTON);
    
  /* read in the model */
  model = glmReadOBJ(model_file);
  scale = glmUnitize(model);
  glmFacetNormals(model);
  glmVertexNormals(model, smoothing_angle);
    
  if (model->nummaterials > 0)
    material_mode = 2;
    
  /* create new display lists */
  lists();
  /*  GLfloat light_position[] = { 1.0, 1.0, 1.0, 0.0 };
  
   glLightfv(GL_LIGHT0, GL_POSITION, light_position);

  glEnable(GL_LIGHTING);
  glEnable(GL_LIGHT0);
  //glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);     
  glEnable(GL_DEPTH_TEST);     
  glEnable(GL_CULL_FACE);
*/

  GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 };
  GLfloat mat_shininess[] = { 50.0 };
  GLfloat light_position[] = { 1.0, 1.0, 1.0, 0.0 };
  glClearColor (0.0, 0.0, 0.0, 0.0);
  glShadeModel (GL_SMOOTH);
  
  glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
  glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess);
  glLightfv(GL_LIGHT0, GL_POSITION, light_position);
  
  glEnable(GL_LIGHTING);
  glEnable(GL_LIGHT0);
   glEnable(GL_DEPTH_TEST);


}