| 145 | A point in view space is transformed to clipping space with the {{{GL_PROJECTION}}} matrix: |
---|

| 146 | |
---|

| 147 | {{{ |
---|

| 148 | #!latex-math-hook |
---|

| 149 | \begin{eqnarray*} |
---|

| 150 | {\boldsymbol P}{\boldsymbol v}&=&{\boldsymbol c} \\ |
---|

| 151 | \text{where} \\ |
---|

| 152 | {\boldsymbol P}&=&\text{projection matrix} \\ |
---|

| 153 | \boldsymbol{v} &=& \text{point in view space} \\ |
---|

| 154 | \boldsymbol{c} &=& \text{point in clip space} \\ |
---|

| 155 | \end{eqnarray*} |
---|

| 156 | }}} |
---|

| 157 | |
---|

| 158 | Given this we can do the opposite by multiplying the clipping space coordinate by the inverse of the {{{GL_PROJECTION}}} matrix. This isn't as bad as it sounds since we can avoid computing a true 4x4 matrix inverse if we just construct the inverse projection matrix at the same time we build the projection matrix. |
---|

| 159 | |
---|

| 160 | A typical OpenGL projection matrix takes the form: |
---|

| 161 | |