Jump to content
  • Advertisement

Archived

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

ShawMishrak

gluPerspective Question

This topic is 6116 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!