Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void display()
- {
- // Clear Screen and Depth Buffer
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- glLoadIdentity();
- // Define a viewing transformation
- gluLookAt( 4,2,0, 0,0,0, 0,1,0);
- // Push and pop the current matrix stack.
- // This causes that translations and rotations on this matrix wont influence others.
- //glTranslatef(0,0,1);
- glPushMatrix();
- glColor3f(1,0,0);
- glRotatef(g_rotation,1,0,0);
- glTranslatef(0, 10,0);
- glRotatef(90,0,1,0);
- // Draw the teapot
- glutSolidTeapot(3);
- glRotatef(g_rotation*5,1,0,0);
- glTranslatef(0, 6,0);
- glRotatef(90,0,1,0);
- glutSolidTorus(0.5, 2.0, 50,50);
- //glTranslatef(0, -4,0);
- //glRotatef(-g_rotation,0,-1,0);
- glPopMatrix();
- g_rotation += g_rotation_speed;
- glutSwapBuffers();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement