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:29:40 EDT (-0400)
  Re: For the love of dot products!  
From: Daniel Patrick Johnson
Date: 14 Apr 2004 16:31:56
Message: <407d9fbc@news.povray.org>
The notation is hard to read.  I think that maybe I would have 
understood what was going on if it was written in MathML.  I found 
http://biokyb.dyndns.org/aknet/cg/ray_sphere_intersect_algebraic/ this 
workout of the problem, and it pretty much matched my own calculations, 
so I decided the book was wrong, and that the POV-Ray code matches what 
is in the link I found.  I'm still not sure if the psudocode explanation 
makes sense.  But I found an overlooked math fact that leads to multiple 
optimizations  If D is actually a unit vector like it is supposed to be 
then D.D has to be "1".  Thus...

The line starting with #local D2 can be removed.  The next line will now 
  be.

#local SQ = DV*DV - (vdot(V,V) - R*R);

And

#local T2 = (-DV-SQ);


Post a reply to this message

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