PDA

View Full Version : glPerspective or glLookAt



joker40
03-20-2011, 07:10 AM
I have large 3d cube that I created and on the screen it looks like 3d wire frame cube. I have also created little cube inside of the bigt cube and little cube was created by call
glutSolidCube(50); but little cube looks flat (doesnt look like 3d). It looks just like square drawn on the screen. I am confused on using glPerspective or glLookAt and where these 2 should be placed inside the program.

McLeary
03-20-2011, 09:07 AM
Do you mean gluPerspective and gluLookAt?

If so, gluPerspective sets up your projection matrix, the matrix that will be applied to all vertices projecting onto the screen. gluPerpective creates a view frustrum.

gluLookAt sets up your camera. Where the camera is and to where the camera is pointing as well as the orientation.

gluPerpective (http://www.opengl.org/sdk/docs/man/xhtml/gluPerspective.xml)
gluLookAt (http://www.opengl.org/sdk/docs/man/xhtml/gluLookAt.xml)