POV-Ray : Newsgroups : povray.advanced-users : For the love of dot products! : Re: For the love of dot products! Server Time
28 Jul 2024 20:25:51 EDT (-0400)
  Re: For the love of dot products!  
From: Daniel Patrick Johnson
Date: 15 Apr 2004 02:16:02
Message: <407e28a2$1@news.povray.org>
Warp wrote:

>>If D is actually a unit vector like it is supposed to be 
> 
> 
>   It isn't. The macro does not assume that the direction vector of the
> ray (D) is a unit vector, and it usually isn't.
> 

I guess you are right.

       Trace(-z*3, <CoordX, CoordY, 3>, 1);

With that 3 in there in what eventually gets thrown into D it clearly 
won't be normalized.  Since the code actually does the ray intersection 
test in this code with every sphere in the scene it might run faster if 
this line did normalize it.

       Trace(-z*3, vnormalize(<CoordX, CoordY, 3>), 1);

But that has a sqrt funtion in it so I'm not sure if the three 
optimizations that run with every ray test will be worth it for the 
number of spheres.

I might get around to testing it later.


Post a reply to this message

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