<p>I am not an OpenGL programmer. My interests mainly lies in algebraic projective geometry. </p>

<p>Per my understanding, The geometric meaning of the projection matrix in the OpenGL function <code>GLFrustum()</code>, which was explained in the  official guide of OpenGL (the nineth edition of the book, OpenGL programming guide-- the official guide to learning OpenGL), from an algebraic point of view, actually corresponds to many geometric meanings that are unluckily different from what the authors expected. </p>

<p>A significant difference between them are:
1. in the official guide, the authors are illustrating a compound linear transform with one of its factors as <code>central projection</code>, so the final compound perspective projecction matrix should be a singular or degenerated matrix;
2. while still in the official guide, at the appendix, the <code>GLFrustum()</code> perspective projection matrix is a nonsingular 4 times 4 square matrix!</p>

<p>Note that: The authors are trying to explain a nonsingular matrix into a theoretically singular one!</p>

<p>The following matrix decomposition (not unique) corresponds to one of the geometric meanings of the nonsingualr <code>GLFrustum()</code> matrix:
<a href="https://i.stack.imgur.com/CUVlA.png" rel="nofollow noreferrer">enter image description here</a></p>

<p>LaTeX code of the formulation: </p>

<pre><code>$$n\underbrace{\color{blue}\left[
\begin{array}{cccc}
 1 &amp; 0 &amp; 0 &amp; 0 \\[12pt]
 0 &amp; 1 &amp; 0 &amp; 0 \\[12pt]
 0 &amp; 0 &amp;\dfrac{n+f}{(n-f) n} &amp; 0 \\[12pt]
 0 &amp; 0 &amp; 0 &amp; 1 \\[12pt]
\end{array}
\right]}_{\color{red}(1)}\cdot \underbrace{\color{blue}\left[
\begin{array}{cccc}
\dfrac{ -2}{l-r} &amp; 0 &amp; 0 &amp; \dfrac{l+r}{l-r} \\[12pt]
 0 &amp; \dfrac{ -2}{b-t} &amp; 0 &amp; \dfrac{b+t}{b-t} \\[12pt]
 0 &amp; 0 &amp; 1 &amp; 0 \\[12pt]
 0 &amp; 0 &amp; 0 &amp; 1 \\[12pt]
\end{array}
\right]}_{\color{red}(2)}\cdot\underbrace{\color{blue}\left[
\begin{array}{cccc}
 1 &amp; 0 &amp; 0 &amp; 0 \\[12pt]
 0 &amp; 1 &amp; 0 &amp; 0 \\[12pt]
 0 &amp; 0 &amp; 1 &amp; 0 \\[12pt]
 0 &amp; 0 &amp; -\dfrac{1}{n} &amp; 1 \\[12pt]
\end{array}
\right]}_{\color{red}(3)}\cdot\underbrace{\color{blue}\left[
\begin{array}{cccc}
 1 &amp; 0 &amp; 0 &amp; 0 \\[12pt]
 0 &amp; 1 &amp; 0 &amp; 0 \\[12pt]
 0 &amp; 0 &amp; 1 &amp; 1 \\[12pt]
 0 &amp; 0 &amp; 0 &amp; \dfrac{1}{n} \\[12pt]
\end{array}
\right]}_{\color{red}(4)}\cdot\underbrace{\color{blue}\left[
\begin{array}{cccc}
 1 &amp; 0 &amp; 0 &amp; 0 \\[12pt]
 0 &amp; 1 &amp; 0 &amp; 0 \\[12pt]
 0 &amp; 0 &amp; 1 &amp; 0 \\[12pt]
 0 &amp; 0 &amp; 0 &amp; \dfrac{2 n f}{f+n} \\[12pt]
\end{array}
\right]}_{\color{red}(5)} $$
</code></pre>

<p>All of the above matrix factors except for No. (2), have their geoemtric meaning clearly redefined in <a href="https://arxiv.org/abs/1307.0998" rel="nofollow noreferrer">Unified Framework of Elementary Geometric Transformations</a>. If you choose this factorization as the geometric meaning explanation of the <code>GLFrustum()</code> perspective projection matrix, you will have to make sure any computation or transforms you are doing in your code are consistent to its geometric meaning.</p>

<p>So when you are programming with OpenGL <code>GLFrustum()</code>, probably may have to compare with what has been illustrated in the official guide and what the <code>GLFrustum()</code> perspective projection matrix really means from the view point of pure algebraic projective geometry, and use any one of your own.</p>
glFrustum, gluPerspective and FOV
<p>I have a program to do augmented reality and in OpenGL I use :</p>

<pre><code>glFrustum(-near*centerImageX/(GLfloat)fx, near*(imageWidth-centerImageX)/(GLfloat)fx, near*(centerImageY-imageHeight)/(GLfloat)fy, near*centerImageY/(GLfloat)fy, near, far);
</code></pre>

<p>This is ok, I get the good perspective and my 3D object is well inserted on my photo. Now I would like to be able to zoom in/out. Normally, it's done by changing fov in gluPerspective but I don't use gluPerspective because I can't get a good insertion.</p>

<p>With <a href="http://dmi.uib.es/~josemaria/files/OpenGLFAQ/transformations.htm" rel="nofollow">http://dmi.uib.es/~josemaria/files/OpenGLFAQ/transformations.htm</a>, question "9.085 How can I make a call to glFrustum() that matches my call to gluPerspective()?", I tried with :</p>

<pre><code>fov=360.0*atan(imageHeight/(2*fy))/Pi;  //computed with parameters top and bottom of my glFrustum
aspect=-centerImageY*fx/(fy*(centerImageX-imageWidth)); //computed with parameters left and bottom of my glFrustum
</code></pre>

<p>void glFrustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far);</p>

<p>void gluPerspective( GLdouble fovy, GLdouble aspect,GLdouble near, GLdouble far );</p>

<p>And then :</p>

<pre><code>gluPerspective(fov, aspect, near, far);
</code></pre>

<p>But my object is distorted, it's not scaled correctly on all axes, ratio is not kept.</p>

<p>So what do I need to do / modify in my glFrustum parameters to get a zoom in / out effect ?</p>