PDA

View Full Version : gluPerspective


supagu
09-23-2005, 06:01 AM
im looking at how to set up my own perspective matrix, as i dont want to use gluPerspective in my code.

http://pyopengl.sourceforge.net/documentation/manual/gluPerspective.3G.html

what is the cotangent?
how do i calulate it in code?

Mihail121
09-23-2005, 06:52 AM
cotangent is the inverse of the tangent function or 1 / tangent. In code this will look like this:



f = 1/tan(deg2rad(fovy/2));

NomadRock
09-23-2005, 05:52 PM
can I ask why it is you dont want to use gluPerspective? If you are going to use an API why not let it work for you?