POV-Ray : Newsgroups : povray.beta-test : vnormalize : Re: vnormalize Server Time
29 Jul 2024 14:25:08 EDT (-0400)
  Re: vnormalize  
From: ingo
Date: 22 Apr 2002 06:52:01
Message: <Xns91F88355A8E3seed7@povray.org>
in news:K0a### [at] econymdemoncouk Mike Williams wrote:

> I'm trying to get some code (actually Ingo's "param.inc" macro) to
> work the same under RC2 as it did before vnormalize(<0,0,0>) became
> an error. 
> 

Mike,

There should be no need to catch vnormalize(0), unless you calculate 
points that don't "resolve" somehow, stuff like lim->0. Using the FromU
() etc. macros helps. See below example (from a somewhat more recent 
version):

#declare R=1;
#declare F1=function(U,V){R*sin(V)*cos(U)}
#declare F2=function(U,V){R*cos(V)}
#declare F3=function(U,V){R*sin(V)*sin(U)}
object { 
  Parametric (
    F1, F2, F3,
    <0, 2*pi>,
    <FromV(0), pi>, //<0,pi> results in an error
    100,50,""
  )
  pigment {rgb 1}
  finish{specular 0.3}
  rotate <0,0,0>
}

Ingo


Post a reply to this message

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