|
|
ooops..... here's a corrected form of the macro....and a demo image
#version unofficial MegaPOV 0.5;
light_source { <0,9,-1> 1 }
light_source { <3,2,-7> color rgb <.3,.3,.3>}
camera
{
location <0,4,-4>
look_at <0,0,0>
}
#declare a=0; // level indicator.
//#declare obj_name=sphere{<0, 0, 0> .5 /*pigment{color rgb 1}*/}
//#declare obj_name=cylinder{<0,-1,0>, <0,1,0>, .25}
#declare obj_name=box{<.5, .5, .5> <-.5,-.5,-.5> /*pigment{color rgb 1}*/}
// c=0 if pigment in object declaration, 1 if pigment done inside macro.
#declare d=
pigment
{
function{sqrt(x*x+y*y+z*z)/2}
color_map
{
[0.000 color rgb <0,1,0>]
[0.333 color rgb <0,0,1>]
[0.667 color rgb <1,1,0>]
[1.000 color rgb <0,1,0>]
}
turbulence .5
}
// d used if c=1.
// e=level maximum (integer value).
// f=number of sides of resulting figure (integer value).
#declare start=<0,0,0>;
// h=scale factor (vector or float)
// i=translate scale factor (float)
// j=descent step per level (positive values cause descent as level number
ascends).
// o=0 if object does not rotate before translation, 1 if rotates.
#declare begin=0;//initial rotation state of object.
#macro polybumpgon(b,c,e,f,g,h,i,j,o,p)
#if (a<e)
#if (c=0)
object{b translate g}
#else
object{b translate g pigment{d}}
#end
#local k=0;
#while (k<f)
#declare a = a + 1;
#local l = <0,-1*j,1/(a*i)>;
#local l = vaxis_rotate(l,<0,1,0>,(360*k/f)+p);
#local m = g + l;
#local q = (360*k/f)+p;
#if (o=0)
#local n = object{b scale h }
#else
#local n = object{b scale h rotate
<0,(360*k/f),0> }
#end
polybumpgon(n,c,e,f,m,h,i,j,o,q)
#declare a = a - 1;
#local k = k + 1;
#end
#end
#end
polybumpgon(obj_name,1,4,7,start,.8,1,.1,1,begin)
Post a reply to this message
Attachments:
Download 'plate_5.jpg' (18 KB)
Preview of image 'plate_5.jpg'
|
|