int x = 0;
void display(void){
gluLookAt(3.0,2.0,5.0,0.0,0.0,0.0,0.0,1.0,0.0);
glClear(GL_COLOR_BUFFER_BIT);
glRotated(x,0.0,0.0,1.0);
glColor3d(0.0,1.0,0.0);
glutWireTeapot(0.5);
glFlush();
}
void myKbd(unsigned char key, int x, int y){
if(key == KEY_ESC)
exit(0);
else if(key == 'g'){
x += 1;
glutPostRedisplay();
}
}
void init(void){
int width = 500, height = 500;
double aspect = (double)width/(double)height;
glClearColor(0.0,0.0,0.0,1.0);
glutCreateWindow("Sample");
glutDisplayFunc(display);
glutKeyboardFunc(myKbd);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(30.0,aspect,1.0,100.0);
}