POV-Ray : Newsgroups : povray.general : Q: reflected vector : Re: Q: reflected vector Server Time
12 Aug 2024 21:20:59 EDT (-0400)
  Re: Q: reflected vector  
From: Ronald L  Parker
Date: 3 Jan 1999 21:50:58
Message: <36922a5e.82603853@news.povray.org>
On Sun, 03 Jan 1999 19:54:03 -0500, John VanSickle
<van### [at] erolscom> wrote:

>Yep, I misunderstood how the last two lines work together, but now that
>I do, 2*par*nN-R is wrong by a factor of -1.

Only if you assume that the ray you're mirroring is incoming, which I
specifically stated I was not.  I even stated that that was not likely
to be how he's doing it.

>Which is wrong, because the original ray is supposed to be *incoming*
>(see the original post).

The original post gives these parameters:

//V - ray direction vector (from intersection to origin)
//N - surface normal

"from intersection to origin" sounds like it's pointing away from the
intersection point, no?

>And it doesn't matter if the direction is reversed on the N vector;
>multiplying N by <-1,-1,-1> causes par to be negated, which undoes the
>negative scaling of N when par and nN are multiplied together.

I didn't say it did matter if N is reversed.  In fact, I verified that
it didn't matter before I posted my solution.  If R is reversed,
however, the sign of both terms is reversed and my result is as
correct as yours, with the added benefits of (a) taking the parameters
the original poster was apparently already using and (b) stating
without uncertainty what exact parameters it does take.  
 
In any case, by now the original poster has resolved any sign
discrepancies he may have encountered, so it's probably safe to drop
it.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.