[csu540-f05-rpf] Differences between original and shadow ray magnitudes

Robert Futrelle futrelle at ccs.neu.edu
Thu Dec 8 13:56:39 EST 2005


One problem that might have plagued some of you, without your quite 
realizing it is the following:

I set up my original TinyRayTrace with a d vector defined as

   Vec(0,0,-1000.0) and an eyepoint at Vec(i,j,500.0)

Then I checked to see that  0.0 < t < 1.0, which meant that
the hit was  between +500 and +500 -1000 = -500 in the scene.

If you're using a normalized L value for your shadow ray and
do the same t test, you'll only see objects within one
pixel of the new eyepoint!  Woops!

You have to treat both rays in the same way.  My suggestion is
that you normalize both d and L and change the t test to something
of the form   0.0 < t < 1000.0 for both, or even 0.0 < t < 2000.0.
The value isn't critical as long as it's large enough. In the future,
this changed code is what I'll make available for students (and
anyone else who finds it on the web - if you google
"ray tracing triangles", two of our course pages are the top two
google hits out of the 18 found.  ;-)

If you think everything else in your system is fine, then
this small change may fix your problems.

Luckily, a student came to my office today - the discussion
led me to think that this might be a problem for some of you.

  - RPF




More information about the csu540-f05-rpf mailing list