|
![](/i/fill.gif) |
By changing things around I can make this actually render something, but
my primary misunderstanding is why it gives its current error message
that I have seen in other macros I have made.
"error: No matching } in object, union found instead."
Well isn't a union treated like an object?
// begin pov code
#include "colors.inc"
light_source {<20,100,-150> rgb 2}
camera {location <0,0,-6> look_at 0}
#macro Arrange_3d (Dimentions_vector,N)
#local A = Dimentions_vector.x;
#local B = Dimentions_vector.y;
#local C = Dimentions_vector.z;
#local Error_loop = 1;
#while (Error_loop <= 3)
#switch (Error_loop)
#case (1)
#local Vect = A;
#case (2)
#local Vect = B;
#case (3)
#local Vect = C;
#end
#if (abs(Vect)<1)
#local Input_error = yes;
#end
#if (Vect-int(Vect.x)>0)
#local Input_error = yes;
#end
#if ((Vect/abs(Vect))<0)
#local Input_error = yes;
#end
#local Error_loop = Error_loop + 1;
#end
#ifdef (Input_error)
#if (Input_error = yes)
#error "Dimentions_vector has a number that is not a natural
number"
#end
#end
( (mod(N+A-1,A))*x + (B-mod(div(N+A-1,A)+B-1,B))*y +
(mod(div(N+B*A-1,B*A)+C-1,C))*z -<A-1,B+1,C-1>/2)
#end // use only natural numbers aka 1,2,3,4,5,6... no fractions 0 or
negative numbers
#macro Grid (Dimentions_vector,Marker_interval,Marker_scale)
#local N = 1;
#while (N <= (((Dimentions_vector.x * 2) +
1)*((Dimentions_vector.y * 2) +1)*((Dimentions_vector.z * 2) + 1)))
#local Grid_vector = Arrange_3d(<(Dimentions_vector.x *
2) + 1,(Dimentions_vector.y * 2) +1,(Dimentions_vector.z * 2) + 1>,N) *
Marker_interval;
union {
sphere {0,.5}
text { ttf "timrom.ttf"
concat("<",str(Grid_vector.x,1,0),",",str(Grid_vector.y,1,0),",",str(Grid_vector.z,1,0),">")
.5 0 translate 1}
scale Marker_scale
translate Grid_vector}
#local N = N+1;
#end
#end
object {Grid(<2,2,2>,1,.1) pigment{Green}}
//end pov code
--
Dan Johnson
http://www.geocities.com/zapob
Post a reply to this message
|
![](/i/fill.gif) |