GluPerspective vs. gluOrtho2D

I have looked at the MSDN documentation about these two functions. However, I don't quite understand the difference between the two except one for setting the camera view for 3D and the other for setting up the camera view for 2D. It would be great if it could be answered. Thanks in advance for your comments.

+2


source to share


1 answer


Orthographic projection is basically a 3D projection that has no perspective. This essentially means that a given position does not get closer to the center of the projection, the further from the viewer. The perspective is obviously the opposite. Because you are dividing by w after projection, this means that a value with a larger W (which is farther from the center of the projection in world terms) will "appear" closer to the center of the projection post w-divide. It is this perspective projection and w-division that gives us a sense of depth in 3D graphics.

If you remember how to draw a cube in the lessons at the beginning of math, you will be reminded that if you draw each of the 2 squares that make up the end of the cube as the same size, the back cube will look larger. This is a spelling projection. It looks strange because our eyes are used to seeing things from a point of view.

IF you shrink this second square, then you get perspective and therefore perspective projection.



There are good images on Wikipedia to demonstrate the difference as well as a good explanation.

Parallel (or Othographic) projection
Perspective (or 3D) projection is a
worthy explanation of perspective in general

+5


source







All Articles