POV-Ray : Newsgroups : povray.general : Array... : Re: Array... Server Time
20 Nov 2024 06:22:33 EST (-0500)
  Re: Array...  
From: F Audet
Date: 15 Oct 2001 11:07:56
Message: <3BCAFAF3.B8207208@sympatico.ca>


> On Sun, 14 Oct 2001 21:39:23 -0400, F.Audet wrote:
> >I decided to do what I wanted to do in simulating an array
> >with two #while loops, and it finally worked.
> >But if you could see why the famous array
> >did not work,  here is the code :
>
> Maybe something having to do with returning a local from a macro; this might
> have been a bug in 3.1 as well.  Try rewriting the macro like this:
>
> >
> >#declare s1 = seed(1);
> >#macro bin_01 ()
> >  #if ( rand(s1) <= 0.5 )
> >    object { nice_zero }
> >  #else
> >    object { nice_one }
> >  #end
> >#end
>

... It does parse and trace,  but nothing appears on the screen.
Messages: 1 frame level object; 1 infinite.   // my plane object !
... I think it is my fault,  cause I just tried,  a minute ago,  with
a simple csg object,  without any kind of randomness and #local,
and it doesn' t work anymore !

in fact,  the following code doesn' t work at all...
#declare YOUR_ARRAY = array[20][20]
#declare i = 0;
#while (i<20)
#declare j=0;
#while (j<20)
#declare YOUR_ARRAY[i][j] = sphere { 0, 1 pigment { White }}
#declare j=j+1;
#end
#declare i=i+1;
#end

Have I to put it into "object {YOUR_ARRAY}", or something like that ?!?

Alex Pilot

>
> --
> #macro R(P)z+_(P)_(P)_(P+1)_(P+1)+z#end#macro Q(C)bicubic_patch{type 1u_steps 6
> v_steps 6R(1)R(3)R(5)R(7)translate 9*z-2pigment{rgb z}}#end#macro _(Y)#local X=
> asc(substr(C,Y,1))-65;<mod(X,4)div(X,4)>#end#local O=union{Q("ABEFUQWS")Q(// RON
> "WSXTLOJN")}Q("JNKLCGCD")union{O}union{O translate 3*x}light_source{x 1}//PARKER


Post a reply to this message

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