well, i am new to 3d modelling and i have a little problem in understanting some basic things…
lets say we have this simple code…
#include <glut.h>
void display()
{
glColor3f(0,0,1);
glClearColor(1,1,1,0);
glClear(GL_COLOR_BUFFER_BIT);
glutWireCube(40);
glFlush();
}
int main(int argc, char **argv)
{
glutInit(&argc,argv);
glutInitWindowPosition(50,50);
glutInitWindowSize(800,600);
glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);
glutCreateWindow("A cube wireframe");
glMatrixMode(GL_PROJECTION);
glOrtho(-80,80,-60,60,0,100);
glMatrixMode(GL_MODELVIEW);
gluLookAt(-30,-30,40,0,0,0,0,1,0);
glutDisplayFunc(display);
glutMainLoop();
return 0;
}
questions:
1.
glMatrixMode(GL_PROJECTION);
glOrtho(-80,80,-60,60,0,100);
what i do here is setting the “dimensions” of the screen??
glMatrixMode(GL_MODELVIEW);
gluLookAt(-30,-30,40,0,0,0,0,1,0);
what i do here is “placing my camera” and determine from where i see the model…?? i have understood each of the arguments, so plz do not explain me this… i have trouble in getting the general idea…
glutWireCube(40);
whats the center of the cube…?? the center of the window?? the arguments of gluLookAt??
can i define the center??
thanks for your time…