[CSC 315] gluPerspective to glFrustum problem

Andrew J. Pounds pounds_aj at mercer.edu
Mon Nov 24 14:26:38 EST 2014


X <#>LatexIt! run report...

*** Found expression $left = -right$
*** Found expression $right = (top) (aspect)$

So problem 1 on page 145 of whitrow is basically asking you to convert 
the glFrustum matrix

https://www.opengl.org/sdk/docs/man2/xhtml/glFrustum.xml

to a gluPerspective matrix.  I was hoping this would help you with your 
programming assignment, but it has apparently caused some of you a great 
deal of trouble.

According to the man page, gluPerspective takes the following arguments...

  void gluPerspective( GLdouble fovy, GLdouble aspect, GLdouble zNear, 
GLdouble zFar )


glFrustum, however, takes a different set of arguments,

        void glFrustum( GLdouble left,    GLdouble right,
                                  GLdouble bottom,  GLdouble top,
                                  GLdouble zNear,   GLdouble zFar )


So, we have to use the fovy and aspect ratio (look these up in the 
OpenGL Red Book online) to come up with equations for
left, right, bottom, top.

Here they are... Happy Thankgiving...

$top = \tan(\frac{fovy}{360}\pi) ( zNear)$
$bottom = -top$
$right = (top) (aspect)$
$left = -right$



Now, because I have given you this you do not have to do problem 1 on 
page 145 of Whitrow -- but you MUST correctly
implement the glFrustum command (as described in the programming 
assignment) to receive credit for getting problem 1 on page 145 of 
Whitrow correct.

Got it?



-- 
Andrew J. Pounds, Ph.D.  (pounds_aj at mercer.edu)
Professor of Chemistry and Computer Science
Mercer University,  Macon, GA 31207   (478) 301-5627
http://faculty.mercer.edu/pounds_aj

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://theochem.mercer.edu/pipermail/csc315/attachments/20141124/1292365c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tblatex-3.png
Type: image/png
Size: 2498 bytes
Desc: not available
URL: <http://theochem.mercer.edu/pipermail/csc315/attachments/20141124/1292365c/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tblatex-4.png
Type: image/png
Size: 1331 bytes
Desc: not available
URL: <http://theochem.mercer.edu/pipermail/csc315/attachments/20141124/1292365c/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tblatex-6.png
Type: image/png
Size: 2000 bytes
Desc: not available
URL: <http://theochem.mercer.edu/pipermail/csc315/attachments/20141124/1292365c/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tblatex-5.png
Type: image/png
Size: 1333 bytes
Desc: not available
URL: <http://theochem.mercer.edu/pipermail/csc315/attachments/20141124/1292365c/attachment-0003.png>


More information about the csc315 mailing list