POV-Ray : Newsgroups : povray.general : Problem with trace() - how to test for ray directions other than towards or= : Re: Problem with trace() - how to test for ray directions other than towards or= Server Time
31 Jul 2024 10:18:08 EDT (-0400)
  Re: Problem with trace() - how to test for ray directions other than towards or=  
From: Tim Attwood
Date: 19 May 2007 17:04:15
Message: <464f664f$1@news.povray.org>
> example:
> #declare Norm = <0, 0, 0>;
> #declare Start = <x-pos, 20, z-pos>;
>
> testing for an intersection on a surface perpendicular to y, would be 
> written as:
> #declare Inter=
>  trace ( MySphere, Start, -y, Norm );
>  etc....
>  )
>
> That is how I do it.
>
> Thomas

Also, if you want to test for a missed ray you should test the
normal for zero length.

#if (vlength(Norm)=0)
   //missed
#else
   //hit
#end


Post a reply to this message

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