|
|
#macro PutGrassLeaf(grassPos, grassPrec, grassSeed)
[...]
#macro qua(aaa,bbb,ccc,ddd)
triangle { aaa, bbb, ccc }
triangle { aaa, ccc, ddd }
#end
[...]
mesh {
#local iii=0; #while (iii<=cfgHeight)
[...]
qua(_a,_b,_bu,_au) qua(_b,_c,_cu,_bu) // front side
qua(_c,_d,_du,_cu) qua(_d,_e,_eu,_du) // right side
[...]
#local iii=iii+1; #end
scale [...] rotate [...] translate grassPos+<0,-2,0>
}
#end // end of PutGrassLeaf
#macro CoverWithGrass(fromX,fromZ,toX,toZ, prec, seed1)
[...]
#local r1=seed(seed1);
#local ix=fromX; #while (ix<=toX)
#local iy=fromZ; #while (iy<=toZ)
PutGrassLeaf( <ix,0,iy>*[...] )
#declare StGrass= StGrass+1;
#local iy=iy+1; #end
#local ix=ix+1; #end
#end
#declare GrassBlocks = array[5]; // 5 types of grass block
#declare I=0; #while (I<5) // create 5 blocks, 10*10 leafs each
#declare GrassBlocks[I] =
union {
CoverWithGrass(0,0,10,10, 25, 12345)
scale .025 [...]
}
#declare I=I+1; #end
// FINAL MACRO - using grass blocks to cover a large area :
#macro CoverWithGrassBlocks(fromX,fromZ,toX,toZ)
#local ix=fromX; #while (ix<=toX)
#local iz=fromZ; #while (iz<=toZ)
object {
GrassBlocks[rand([...])*5] // select grass block #0..#4
translate <ix,0,iz>
}
#local iz=iz+GBSizeZ; #end
#local ix=ix+GBSizeX; #end
#end
// FINAL OBJECT
union {
CoverWithGrassBlocks(-150,-150,+150,250)
texture { [...] }
}
--
#macro g(U,V)(.4*abs(sin(9*sqrt(pow(x-U,2)+pow(y-V,2))))*pow(1-min(1,(sqrt(
pow(x-U,2)+pow(y-V,2))*.3)),2)+.9)#end#macro p(c)#if(c>1)#local l=mod(c,100
);g(2*div(l,10)-8,2*mod(l,10)-8)*p(div(c,100))#else 1#end#end light_source{
y 2}sphere{z*20 9pigment{function{p(26252423)*p(36455644)*p(66656463)}}}//M
Post a reply to this message
|
|