|
|
// initalize the array
#macro InitGrid ()
#local i = 0;
#while ( i < 10 )
#local j = 0;
//RESET J HERE !!!
#while ( j < 10 )
#declare MyGrid[i][j] = 1;
#local j = j + 1;
#end
#local i = i + 1;
#end
#end
#macro DrawGrid ()
#local i = 0;
#while (i < 10 )
//RESET J HERE !!!
#local j = 0;
#while ( j < 10 )
sphere { <i*2,2,j*2> MyGrid[i][j]
pigment { red 1 }
finish { phong 1 } }
#local j = j + 1;
#end
#local i = i + 1;
#end
#end
I set the comments. Sorry for screaming :-)
you only have to reinit J to 0 every outer loop, or it will only happen ince.
And, use #local inside a macro.
--
//Spider
( spi### [at] bahnhofse ) [ http://www.bahnhof.se/~spider/ ]
#declare life = rand(seed(42))*sqrt(-1);
Post a reply to this message
|
|