Advertisement
Guest User

tetera

a guest
Sep 1st, 2014
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.83 KB | None | 0 0
  1. void display()
  2. {
  3.     // Clear Screen and Depth Buffer
  4.     glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  5.     glLoadIdentity();
  6.  
  7.     // Define a viewing transformation
  8.     gluLookAt( 4,2,0, 0,0,0, 0,1,0);
  9.  
  10.  
  11.     // Push and pop the current matrix stack.
  12.     // This causes that translations and rotations on this matrix wont influence others.
  13.     //glTranslatef(0,0,1);
  14.  
  15.     glPushMatrix();
  16.         glColor3f(1,0,0);
  17.  
  18.         glRotatef(g_rotation,1,0,0);
  19.         glTranslatef(0, 10,0);
  20.         glRotatef(90,0,1,0);
  21.  
  22.  
  23.  
  24.  
  25.         // Draw the teapot
  26.         glutSolidTeapot(3);
  27.  
  28.  
  29.         glRotatef(g_rotation*5,1,0,0);
  30.         glTranslatef(0, 6,0);
  31.         glRotatef(90,0,1,0);
  32.         glutSolidTorus(0.5, 2.0, 50,50);
  33.  
  34.         //glTranslatef(0, -4,0);
  35.         //glRotatef(-g_rotation,0,-1,0);
  36.     glPopMatrix();
  37.  
  38.  
  39.     g_rotation += g_rotation_speed;
  40.     glutSwapBuffers();
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement