For the glut functions that draw the geometric figures, like the shpere, and cone: does OpenGL always draw them in the center of the window? It seems that way.
For example:
void pyramid();
void display();
void init();
int main()
{
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize(1000, 1000);
glutInitWindowPosition(20, 20);
glutCreateWindow(“Homework 2”);
init();
glutDisplayFunc(display);
glutMainLoop();
return 0;
}
void display()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glColor3f(0.50, 0.60, 0.70);
glTranslatef(80.0, 150.0, 0.0);
glRotatef(120.0, 1.0, 0.0, 0.0);
glRotatef(30.0, 0.0, 1.0, 0.0);
glutWireCone(200.0, 300.0, 4, 0);
glLoadIdentity();
//glTranslatef(0.0, 0.0, 100.0);
//glRotatef(120.0, 1.0, 0.0, 0.0);
glutWireCone(200.0, 300.0, 4, 0);
glutSwapBuffers();
}
void init()
{
glClearColor(0.0, 0.0, 0.0, 0.0);
glMatrixMode(GL_PROJECTION);
glOrtho(-500.0, 500.0, -500.0, 500.0, -500.0, 1000.0);
glMatrixMode(GL_MODELVIEW);
}