Пример #1
0
void display(void) {
  
  glLoadIdentity();
  glClearColor(0.0f,0.0f,0.0f,1.0f);   //set the background colour 
  // OK, now clear the screen with the background colour 
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
  
	
	/* Place the camera in various positions in the secene */
	
	if(curTime >= 0 && curTime <= 3){ 
		gluLookAt(-12,5,30,0,5,0,0,1,0);
	}
	else if(curTime > 3 && curTime <= 6){
		gluLookAt(-12,5, 10, 0, 7, 0, 0, 1, 0);
	}
	else if(curTime > 6 && curTime <= 10.75){
		gluLookAt(0, 5, 30, 0, 5, 0, 0, 1, 0);
	}
	else if(curTime > 10.75 && curTime <= 11.5){
		gluLookAt(-12, 7, -8, 0, 4, -2, 0, 1, 0);
	
	}
	else if(curTime > 11.5 && curTime <= 12){
	
		gluLookAt(11, 25, -30, -2,5, 0, 0, 1, 0);
	}
	else {
		gluLookAt(-12,5, 10, 0, 7, 0, 0, 1, 0);
	}	
	
	drawWalls();
	drawColumnSet();
	drawStairs();
	drawCube();
	drawSphere();
	drawPlatform();
	drawPyramid();
 	
	glPushMatrix();
	drawMan();
 	glPopMatrix();
	
	
	drawHammer();
	glFlush();

  glutSwapBuffers();

  if (recording) {
    int frame = (int)(curTime / tStep + 0.5);
    save_image(frame);
  }      
}
Пример #2
0
void Renderer::draw(const double time) {
	beginFrame();
	pushPopped([this] { drawGround(); });
	pushPopped([this] { drawMan(); });
	pushPopped([this] { drawManBodyCenter(); });
}