POV-Ray : Newsgroups : povray.general : for loops : Re: for loops Server Time
5 Aug 2024 14:11:36 EDT (-0400)
  Re: for loops  
From: Gwen & Emory Stagmer
Date: 11 Sep 2002 00:50:47
Message: <3D7ECCCF.ADD397E4@comcast.net>
No, don't actually try that!! x is a pre-defined vector
( <1,0,0> ) and re-defining it would be "a bad thing"...
Here's a variation (just to play around with vectors!):

#declare myvec = x;
#declare endvec = x*10;
#while (myvec <= endvec)
    sphere
	{
	myvec, .5 texture{ pigment { color rgb myvec/10 } }
	}
    #declare myvec = myvec + x;
#end

'because I can'...

    Emory


Kevin Loney wrote:
> 
> try this
> 
> #declare x = 0;
> #while(x<10)
>     sphere {
>         <x, 0, 0>, .5
>         texture {
>             pigment { color Red }
>         }
>     }
>     #declare x=x+1;
> #end
> 
> --
> Kevin
> http://www.geocities.com/qsquared_1999/
> #macro _(r)#if(r<12)#local i=asc(substr("oqshilacefg",r,1))-97;
> disc{<mod(i,7)-3,div(i,7)-1,6>,z,.4pigment{rgb 10}}_(r+1)
> #end#end _(1)//KL


Post a reply to this message

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