reset password
Author Message
skim144
Posts: 63
Posted 12:01 Jun 07, 2015 |
1. For storing pseudo depth information, why doesn't opengl implement use conversion equation like this?
(Pz - N)/(F-N) = (z*+1)/2
 
2. How are equations  z* = (a*Pz + b)/(-Pz)   , a value, and b value derived?
lmann2
Posts: 156
Posted 17:16 Jun 07, 2015 |
skim144 wrote:
 
2. How are equations  z* = (a*Pz + b)/(-Pz)   , a value, and b value derived?
 
 

a = -(F+N) / (F-N)

b = (-2FN/F-N)

pg350

"we choose them so that the pseudodepth varies between -1 and 1" pesudodepth produces *z the depth of point P that we need because projection discards depth information that we need for things like clipping.  I don't know if that answered your question, but I hope it helps. 

skim144
Posts: 63
Posted 17:38 Jun 07, 2015 |
Thanks Laura, i was actually asking how these values a = -(F+N) / (F-N) b = (-2FN/F-N) Were derived. If i learn how to derive it, it would help me remeber it. But nowhere in the book i could find the derivation.
Last edited by skim144 at 17:39 Jun 07, 2015.
lmann2
Posts: 156
Posted 18:03 Jun 07, 2015 |
skim144 wrote:
Thanks Laura, i was actually asking how these values a = -(F+N) / (F-N) b = (-2FN/F-N) Were derived. If i learn how to derive it, it would help me remeber it. But nowhere in the book i could find the derivation.

That's what I thought, but I wasn't sure.  The book just mentions that the choice is arbitrary, but "we find out later why that's a good choice", lol. I think the choice has something to do the preserving depth along the z-axis.  Also, I agree, being able to derive all the equations in this class would solve everything memorizing is a waste of time.

   

eykang
Posts: 95
Posted 10:11 Jun 08, 2015 |

It is a simple derivation.

Given z* = (a*Pz + b)/(-Pz), to calculate a and b,

use Pz=-N when z*=-1 and Pz=-F when z*=1.

The given equation expresses the inverse relationship of z* and Pz.

Last edited by eykang at 10:56 Jun 08, 2015.
skim144
Posts: 63
Posted 10:38 Jun 08, 2015 |

got it. Thanks!

Last edited by skim144 at 11:00 Jun 08, 2015.