Ejemplo n.º 1
0
void 
display ()
{
  glClear ( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );

  root->update(0.033); // assumes called at 30Hz

  // mouse control 
  mat4 tball = trackball.getMat4();
  mat4 mv = modelviewMatrix * tball;

  root->draw(mv, projectionMatrix );

  glutSwapBuffers();
}
Ejemplo n.º 2
0
void display ()
{
  glClear ( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );

  root->update(0.033); // assumes called at 30Hz

  mat4 tball = trackball.getMat4();
  mat4 mv = modelviewMatrix * tball;

  if (currentFrame == endFrame) {
    currentFrame = startFrame;
  } else {
    currentFrame++;
  }

  Ptr<Material> mat;
  //  dynamic_cast<Instance*>(root)->getChild ( currentFrame-startFrame )->draw(mv,projectionMatrix,mat);
  root->getChild ( currentFrame-startFrame )->draw(mv,projectionMatrix,mat);

  glutSwapBuffers();
}