示例#1
0
文件: tp3.c 项目: confiture/M2
/****************
 *
 * fonction d'affichage du systeme
 *
 ****************/
void display()
{
	/* glClearColor (0.0, 0.0, 0.0, 0.0); */
	glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

    /* si le type de tracé est ligne on desactive l'éclairage */
    if(mode==GL_LINE_STRIP)
		glDisable(GL_LIGHTING);
	/* sinon on réactive l'eclairage */
	else
		glEnable(GL_LIGHTING);

	glLoadIdentity();  /* repere camera */

	tbVisuTransform(); /* origine et orientation de la scene */

	/* echelle */
	glScalef(zoom*eX,zoom*eY,zoom*eZ);

	/* centrage de la scene                    */
	/* prise en compte de la boite englobante  */
	glTranslatef( -(xmin+xmax)/2.0,
	              -(ymin+ymax)/2.0,
	              -(zmin+zmax)/2.0);

	/* dessin des triangles du MarchingCube */
	drawMarchingTetrahedra();

	/* envoi des commandes GL */
	glFlush();
	glutSwapBuffers();
}
示例#2
0
文件: VolRawData.c 项目: confiture/M2
void redraw(void)
{
  int start, end;

  if (reportSpeed) {
    start = glutGet(GLUT_ELAPSED_TIME);
  }

  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

  glLoadIdentity();  /* repere camera */

	  tbVisuTransform(); /* origine et orientation de la scene */

      glScalef(zoom,zoom,zoom);
      glTranslatef( -sx/2., -sy/2., -sz*hz/2.);

      drawSlices();
      drawSlicesBoundary();
	drawIsoCurveZ();
	drawIsoCurveX();
	drawIsoCurveY();

  if (reportSpeed) {
    glFinish();
    end = glutGet(GLUT_ELAPSED_TIME);
    printf("Speed %.3g frames/sec (%d ms)\n", 1000.0/(end-start), end-start);
  }

  glutSwapBuffers();
}
示例#3
0
/**
 * This is the display callback function.
 * It is called when GLUT determines that the normal plane for the window needs to be redisplayed.
 * The entire normal plane region should be redisplayed in response to the callback.
 */
void displayInternal(void)
{
    // Effacer tout
    glClearColor (0.0, 0.0, 0.0, 0.0);
    glClear( GL_COLOR_BUFFER_BIT  | GL_DEPTH_BUFFER_BIT); // la couleur et le z
    
    glLoadIdentity();  // repere camera

    tbVisuTransform(); // origine et orientation de la scene

    display( );    

    glutSwapBuffers();
    glutPostRedisplay();
}
示例#4
0
//what to do before drawing an image
 void display(void)
{
	glPushAttrib(GL_ALL_ATTRIB_BITS);//store GL state
    // Effacer tout
    glClear( GL_COLOR_BUFFER_BIT  | GL_DEPTH_BUFFER_BIT); // clear image
    
    glLoadIdentity();  

    tbVisuTransform(); // init trackball

    drawFrame( );    //actually draw

    glutSwapBuffers();//glut internal switch
	glPopAttrib();//return to old GL state
}
// Actions d'affichage
// Ne pas changer
void display(void)
{
	glPushAttrib(GL_ALL_ATTRIB_BITS);
    // Effacer tout
    glClear( GL_COLOR_BUFFER_BIT  | GL_DEPTH_BUFFER_BIT); // la couleur et le z

    glLoadIdentity();  // repere camera

    tbVisuTransform(); // origine et orientation de la scene

    dessiner( );

    glutSwapBuffers();
	glPopAttrib();
}