예제 #1
0
파일: MyGLWidget.cpp 프로젝트: ealch/IDI
void MyGLWidget::paintGL () {
  // Esborrem el frame-buffer i el depth-buffer
  glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

  iluminacion();
  
  
  // Activem el VAO per a pintar el terra 
  glBindVertexArray (VAO_Terra);
  modelTransformTerra();
  // pintem
  glDrawArrays(GL_TRIANGLES, 0, 12);
  
  //Patricio1
      // Activem el VAO per a pintar el Patricio
      glBindVertexArray (VAO_Patr);
      modelTransformPatricio();

      // Pintem l'escena
      glDrawArrays(GL_TRIANGLES, 0, patr.faces().size()*3);
  
  
  
  glBindVertexArray(0);
}
예제 #2
0
void MyGLWidget::paintGL ()
{
  //serveix per inicialitzar el focus
  focusTransform();

  // Esborrem el frame-buffer i el depth-buffer
  glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

  // Activem el VAO per a pintar el terra 
  glBindVertexArray (VAO_Terra);

  modelTransformTerra ();

  // pintem
  glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);

  // Activem el VAO per a pintar el Patricio
  glBindVertexArray (VAO_Patr);

  modelTransformPatricio ();

  // Pintem l'escena
  glDrawArrays(GL_TRIANGLES, 0, patr.faces().size()*3);

  //lego
  glBindVertexArray (VAO_lego);

  modelTransformLego();

  // Pintem l'escena
  glDrawArrays(GL_TRIANGLES, 0, lego.faces().size()*3);

  
  glBindVertexArray(0);
}