Understanding Perspective Devide

Started by
2 comments, last by TheChubu 9 years, 6 months ago

**Divide** :/

Hi,

Im hoping someone can help me out here, Im blowing the dust off my maths knowledge, the little that there is tongue.png
I know that an understanding of the maths behind the perspective divide isint really needed, but I found it interesting, but unfortunatly I have got stuck on something basic, and while I am awating the maths book I have bought off amazon ( taking 3 weeks longer to come from america, but strangly still €30 cheeper smile.png ) I tought i could ask here.

I am currently following along a great guide here:

http://unspecified.wordpress.com/2012/06/21/calculating-the-gluperspective-matrix-and-other-opengl-matrix-maths/

I can follow along with this:


tan( fovy / 2 ) = y / -z
y               = tan( fovy / 2 ) x -z

( Nothing compliticated.. Its the next jump I dont understand )

We can simplify the following maths if we define:


f =  1 / tan( fovy / 2 )
then
y = -z / f

Now from what I have read, the 1/tan is the cotangent of the angle, but im just not sure how the tan of an angle multiplied to -z, is the equivalant to -z divide cotangant of angle.

This may make perfect sense to others, but as someone who had never heard of a cotangent before .. it was a bit confusing tongue.png

From what i under stand, the cotangent is just cos flipped. I have tried looking up some trig to help me along, but I cant seem to find what relates here, Im either getting too basic trig, or jumping onto what i would consider advanced.

If someone could point me in the right direction, i would appreciate it

Thanks

Advertisement

  a           c
----- =  a * ---
(b/c)         b

That's a known property valid when b and c are not 0.

Replace "a" with "-z", "b" with "1" and "c" with "tan(q)" and you get


    -z             tan(q)
---------- = -z * --------
(1/tan(q))           1

which is


  -z             
-------- = -z * tan(q)
 cot(q)

EDIT: For the first property, a simple prove is to multiply by "c / c" (which is 1, so doesn't change the value):


  a       c             c             c
-----  * --- = a * ----------- = a * ---
(b/c)     c         (b * c/c)         b

Thanks Diego,

That's quite easy to follow, and makes sense. And from your mention of known property, I know have something to research for helping me with the rest of the article. And as an added bonus, I have received a call to say my book has arrived 3 weeks early.. Good day all around :D

Thanks again !

** stuff **
Your ASCII math is flawless.

"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

My journals: dustArtemis ECS framework and Making a Terrain Generator

This topic is closed to new replies.

Advertisement