Advertisement

Perspective projection: Intersection length between light and view

Started by November 26, 2013 12:39 PM
3 comments, last by obhi 11 years, 2 months ago

Hi,

I have always wondered on this, may be i am missing something very simple, in the perspective shadow map calculation from the paper: http://www.cs.berkeley.edu/~ravir/6160-fall04/papers/p557-stamminger.pdf

In section 1.1, it mentions that when a ray bundle from shadow map hits the surface at a distance rs with an angle substended at alpha, and the shadow map pixel width is ds, the lenght of the surface hit is equal to approximately: dsrs/(cos(alpha).

How do we arrive at this derivition?

Any help is much appreciated.

Thanks,

obhi

What if everyone had a restart button behind their head ;P

The ds * rs part is the inverse square law. Here you are only considering the width and not the whole area, so it increases linearly with distance as you would expect (if you stare at an object through a camera at a distance D and see it records a length of X pixels, then walk back to a distance 2D, its length will have decreased to X/2 pixels).

479px-Inverse_square_law.svg.png

The cosine division part is basically the cosine law in action:

fig6-3.gif

So as the angle approaches 90 (grazing) the perceived length gets smaller and smaller. So if you start with a ray bundle that hits a surface with an perceived width of ds, the true length is going to get larger as the angle tends to grazing (here think of ds as the width of the blue beam). Of course if you are looking at it at normal incidence, then its true length is the same as its perceived length, and cos(alpha) = 1 as expected.

“If I understand the standard right it is legal and safe to do this but the resulting value could be anything.”

Advertisement

So at 2D the lenght becomes X/2, which means a the surface pixel count should be (for rs units) rs*ds. And the blue line: d*cos(theta) = percieved length = rs*ds (from inverse sq).. Thanks a lot :)

What if everyone had a restart button behind their head ;P

So at 2D the lenght becomes X/2, which means a the surface pixel count should be (for rs units) rs*ds. And the blue line: d*cos(theta) = percieved length = rs*ds (from inverse sq).. Thanks a lot smile.png

Yes, that's right (sorry for the typo, it's late smile.png - fixed)

“If I understand the standard right it is legal and safe to do this but the resulting value could be anything.”

No problem, you provided a very helpful pictorial explanation :)

What if everyone had a restart button behind their head ;P

This topic is closed to new replies.

Advertisement