POV-Ray : Newsgroups : povray.general : Q: reflected vector : Re: Q: reflected vector Server Time
12 Aug 2024 21:26:13 EDT (-0400)
  Re: Q: reflected vector  
From: Margus Ramst
Date: 1 Jan 1999 22:15:57
Message: <368d8f6d.0@news.povray.org>
Thanks, this might be it (didn't quite get it yet, my brain isn't working
too well around this time of the year...)

Margus

Ronald L. Parker wrote in message <36920d89.71268632@news.povray.org>...

>Why not determine the component of the ray that does not lie along the
>
>normal vector, negate it, and add it back to the componenent that does
>lie along the normal?  something like this (untested) code:
>
>// This assumes that R is relative to the intersection point and
>// points AWAY from the intersection point.  This is probably not
>// the way you have it set up if you're using the SuperPatch.
>
>// R = ray
>// N = normal
>
>#macro mirror( R, N )
>  #local nN = vnormalize( N );
>  #local par = vdot( R, nN );
>  #local perp = R-par*nN;
>  par*nN-perp
>#end
>
>Something else to chew on: I've added XenoArch's projected_through
>patch to the next version of the superpatch, and that will allow easy
>simulation of reflective caustics from planar surfaces, for the price
>of an extra light source per reflected light source per reflective
>surface.
>


Post a reply to this message

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