POV-Ray : Newsgroups : povray.windows : This Scrip is not working on POV 3.1 ... BUG ? : Re: This Scrip is not working on POV 3.1 ... BUG ? Server Time
28 Jul 2024 16:31:11 EDT (-0400)
  Re: This Scrip is not working on POV 3.1 ... BUG ?  
From: F VERBAAS
Date: 12 Jul 1998 13:14:26
Message: <35a8e0e2.0@news.povray.org>
Could it be that it does not like the lines arrowed below? You are fiddling
with variables used to call your macro, declared outside the macro's scope.

Better try giving XX and YY a different name within the macro. They are
local variables, and you avoid a lot of confusion by naming them
differently.

I am not certain whether a macro is called by value or by reference. Calling
by value would mean that any changes to the value of the local variables
will not be found in the calling body.

Frans

.......
some code
.....
>#macro point (xx,yy)
>    #local ro=max((1-3*sin(2*yy)*sin(5*xx+pi/2)),0);
>    #declare zn=-ro*sin(yy)*cos(xx);
>    #declare xn=ro*sin(yy)*sin(xx);
>    #declare yn=ro*cos(yy);
====>    #declare xx=xx+deltax;   <============ this may be ambiguous !!!
>    #local ro=max((1-3*sin(2*yy)*sin(5*xx+pi/2)),0);
>    #local zp=-ro*sin(yy)*cos(xx);
>    #local xp=ro*sin(yy)*sin(xx);
>    #local yp=ro*cos(yy);
====>    #declare xx=xx-deltax;  <============ So for this !!
====>    #declare yy=yy+deltay; <============ and this !!
>    #local ro=max((1-3*sin(2*yy)*sin(5*xx+pi/2)),0);
>    #local zq=-ro*sin(yy)*cos(xx);
>    #local xq=ro*sin(yy)*sin(xx);
>    #local yq=ro*cos(yy);
=====>    #declare yy=yy-deltay; <============ another
>    #declare vn=vcross(<xp-xn,yp-yn,zp-zn>,<xq-xn,yq-yn,zq-zn>);
>#end                                           // end of macro

>#declare etoile = mesh {
>  #declare xx = xmin;               <================
>  #while (xx<xmax)                        //outer loop
>    #declare yy = ymin;
>    #while (yy<ymax)                      //inner loop
>//POINTS
>    point(xx,yy)                          <================
______________________________________________________________________


Post a reply to this message

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