|
![](/i/fill.gif) |
I had a couple of requests to post this after posting my FNORD still and
animation. This it a patch of grass that can be cyclically animated.
Heret's the Source:
#declare SL=0.2
#declare SN=5
#declare SSS=0.12
#declare GRS=seed(45098)
#declare GSS=SSS*2.5
#declare GrassPatch=union{
#declare X=0
#while (X<4)
#declare Z=0
#while (Z<4)
#declare GA=pi/2
#declare GAA=(pi/60+sin((rand(GRS)+clock)*pi*2)/30)*3
#declare I=0
#declare LGRX=0
#declare LGRY=0
#declare LGRZ=SSS
mesh{
#while (I<SN)
#declare GRX=LGRX+SL*cos(GA)
#declare GRY=LGRY+SL*sin(GA)
#declare GRZ=SSS*(1-1/SN*(I+1))
triangle{<LGRX,LGRY,LGRZ>,<GRX,GRY,GRZ>,<LGRX-LGRZ,LGRY,0>}
triangle{<GRX,GRY,GRZ>,<LGRX-LGRZ,LGRY,0>,<GRX-GRZ,GRY,0>}
triangle{<LGRX,LGRY,-LGRZ>,<GRX,GRY,-GRZ>,<LGRX-LGRZ,LGRY,0>}
triangle{<GRX,GRY,-GRZ>,<LGRX-LGRZ,LGRY,0>,<GRX-GRZ,GRY,0>}
#declare LGRX=GRX
#declare LGRY=GRY
#declare LGRZ=GRZ
#declare GA=GA-GAA
#declare I=I+1
#end
translate <X+GSS*(0.5-rand(GRS)),0,Z+GSS*(0.5-rand(GRS))>
}
#declare Z=Z+GSS
#end
#declare X=X+GSS
#end
}
Pretty small, isn't it? ;)
As you can see it makes a lot of random grass and animates it with the
clock. Color it yourself.
- Heretic
Post a reply to this message
|
![](/i/fill.gif) |