Exemplo n.º 1
0
LoadOBJ::LoadOBJ(const char *filename, GLuint m)
{


  xlow = xhigh = ylow = yhigh =  zlow = zhigh = 0.0;
  vboId = 0; 
  vboIndex = 0;

  numIndices = 0;
  numVertices = 0;
  mid = m;
  std::cout << "initializar" << std::endl;

  if(!ReadOBJModel(filename))
    exit(1);
  std::cout << "initializado" << std::endl;
  passToVBO();
}
Exemplo n.º 2
0
void
init (const char *filename)
{
  GLfloat lightpos[] = { 5.0f, 10.0f, 0.0f, 1.0f };

  /* Initialize OpenGL context */
  glClearColor (0.5f, 0.5f, 0.5f, 1.0f);
  glShadeModel (GL_SMOOTH);

  glEnable (GL_DEPTH_TEST);
  glEnable (GL_LIGHTING);
  glEnable (GL_LIGHT0);

  glLightfv (GL_LIGHT0, GL_POSITION, lightpos);

  /* Load OBJ model file */
  if (!ReadOBJModel (filename, &objfile))
    exit (EXIT_FAILURE);
}