View Full Version : glOrtho or gluPerspective ....
10-15-2000, 01:14 PM
Hello guys!!! http://www.opengl.org/discussion_boards/ubb/smile.gif
Can someone explain me witch is the diference between glOrtho and gluPerspective, I was trying to draw some lines in the screen using gluPerspective, and it didnīt work, then I use glOrtho, and it works fine, why ????
Thank you for the moment
10-15-2000, 11:49 PM
Well, glOrtho is for orthographic projection and gluPerspective is for perspective projection. As for the difference, in orthographic projection the "rays" passing through the pixels are all parallel whereas in perspective projection they all "shoot out" from the eye an pass through the pixels. I suggest you read a 3D computer graphics book (the Foley & Van Dam is a must) to fully understand the mechanics of 3D to 2D projection.
10-16-2000, 01:18 AM
Witch is the better way to use, if I'm developing a CAD system ?
Thank ou for the moment
Very nice answer Olive...
In a CAD environment, orthographic projection is the way to go. You can place objects "on top of" eachother without messing with the fact that objects gets smaller the further away they are, which is the case in perspective projection.
10-16-2000, 07:19 AM
Right, Bob. But most CAD's have the possibility to look at the model in perspective mode. For construction its useless, but when you look the first time at a model, it gives you a better understanding of the shape (IMHO).
10-16-2000, 09:09 AM
Is it what I was thinking about, when I'm creating the CAD model, it is better to use an Orthogonal projection, but when we want to view, like in a shading view, it's better to use a perpective projection.
Thank you guys,
PS.: But can someone explain me why the lines didn't appear using the Perpective projection, I just replace the perspective code to the orthogonal code, and then it works.
Kilam: Yeah, of course, but I was refering to the construction part though. So I say it too: Ortho for construction and perspective for viewing http://www.opengl.org/discussion_boards/ubb/rolleyes.gif
10-17-2000, 05:36 AM
can you post the glFrustum or gluPerspective code line?
One suggestion why you arent seeing what you render with a perspective projection matrix...
When you set up your perspective matrix, the default 'camera' position is (0,0,0). You viewing direction is down the -Z axis. This isnt an actual camera, its where you are viewing from in world coordinates.
So my guess is you didnt transform your rendered objects away from the 'camera' sufficiently enough to view them.
glTranslatef(0., 0., -10.);
glutSolidSphere(3, 25, 25);
If you are contemplating coding a *useable* solid modeler, you have your work cut out for you. This is by no means an easy task. http://www.opengl.org/discussion_boards/ubb/eek.gif
10-19-2000, 04:58 AM
I will try to do that, sorry for the long time, that this reply took, I had particular problems.
Thank you guys for all your help.
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.