View Full Version : gluPerspective after glOrtho

11-18-2004, 11:18 PM
Hei Everybody!
I just started to study OpenGL and have some problems with perspective projection.
I have a program in which a cube bouncing on the screen. If I create my 3D space like


it works without any troubles. But if I change to


Either I can't see anything in my window or I can notice that my viewing-point is somewhere 'in the created space' and the cube can go 'behind me'.
How could I manage to see the same space just like with glOrtho?
Is it necessary to use gluLookAt(...) with glPerspective? What is the default viewing-point after creating a space with gluPerspective? Is there a process to calculate gluPerspective() from glOrtho?

Thx: tmgergo

11-19-2004, 12:08 AM
Is it glFrustum(), glFrustrum() or glFustrum() ???

11-19-2004, 12:28 AM
Hi !

If you don't transform the "camera" it is located at 0,0,0 so you would maybe need to at least do a translate(0,0,z) to make your stuff visible.

The faq on this website has lots of helpful information on this, have a look in the transformation section.