Hey i don’t now much about selection. And i’m not sure if this is exactly what you are looking for but i hear the functions glProject and glUnproject getting thrown around a lot for selection.
They can be used for selection, but OpenGL also has a specific render mode for selection where it records which primatives end up in a specific area, which is what i’m trying to use. Anyone have any other ideas? Otherwise i might have to use glProject/unProject.
Orthographic projection is as much 3D as perspective projection. It just lacks perspective.
Selection with orthographic projection should not be any different from selection in perspective projection. It should be enough to replace gluPerspective with glOrtho instead. The selection mechanism in OpenGL is independent of type of projection.
Yes it is the same, gluPickMatrix can be used in glOrtho mode. I was thrown by documentation refering to it defineing a ‘frustrum’ which I figured would be specific to 3D.
The problem was elsewhere, and it now works. Thanks guys!
With an orthographic projection matrix, you can still use the depth buffer to eliminate hidden objects, objects too far away are still clipped by the far clip plane, fogging will still fog the objects based on distance from the viewpoint, and so on. All objects have a depth, apart from left/right and up/down; three dimensions are present.
Orthographic projection are usually used to do 2D drawings, but that doesn’t make orthographic projection itself 2D.