POV-Ray : Newsgroups : povray.programming : How normal vector computation works in Povray ? : Re: How normal vector computation works in Povray ? Server Time
1 Jul 2024 06:35:51 EDT (-0400)
  Re: How normal vector computation works in Povray ?  
From: Slime
Date: 21 May 2004 05:50:03
Message: <40add0cb@news.povray.org>
>   dist = sqrt(P[X] * P[X] + P[Z] * P[Z]);
>   if (dist > EPSILON)
>   {
>     M[X] = Torus->R * P[X] / dist;
>     M[Y] = 0.0;
>     M[Z] = Torus->R * P[Z] / dist;
>   }
>   else
>   {
>     Make_Vector(M, 0.0, 0.0, 0.0);
>   }
>   VSub(N, P, M);

I love it when seemingly difficult things are done so simply like this.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

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