Archived

This topic is now archived and is closed to further replies.

ShawMishrak

gluPerspective Question

Recommended Posts

I am writing an OpenGL wrapper, and am trying to not use the helper libraries such as GLU. I am wondering what the math behind this function call is, so I can code a custom version of it to eliminate the use of GLU. Thanks in advance.

Share this post


Link to post
Share on other sites
These three pages describe perspective projection in detail. The first two are a build up to the last one, which covers the creation of a perspective projection matrix.
http://www.cs.kuleuven.ac.be/cwis/research/graphics/INFOTEC/viewing-in-3d/node6.html
http://www.cs.kuleuven.ac.be/cwis/research/graphics/INFOTEC/viewing-in-3d/node7.html
http://www.cs.kuleuven.ac.be/cwis/research/graphics/INFOTEC/viewing-in-3d/node8.html
Note that those pages don''t cover OpenGL so don''t expect to find the source code to gluPerspective there. It will help you to create it yourself though.

Share this post


Link to post
Share on other sites
Do look out though, these pages have the positive Z-axis pointing out of the screen while the OpenGL Z-axis points into the screen. Also, the matrices used in the pages would have to be loaded into OpenGL like this:

0 1 2 3
4 5 6 7
8 9 10 11
12 13 14 15

Share this post


Link to post
Share on other sites