CF::Size=[s 7 5.25 y -1.5] //(800*600) CF::Background=[b -0.9] CF::Size=0.1 CF::Impure=1 S=sqrt(0.5) // Deflation W=(0,0,0,1) // Worldstate (x y r s)
startshape TREE(W)
shape TREE(vector4 W) { DSQUARE(W)[sat 1 b (1-W/2)]
if (W[3]>0.001) transform[z 1] { TREE(WA(W,(-.5, 1, 45, S)))[h 8] TREE(WA(W,( .5, 1,-45, S)))[h 2]
} }
path DSQUARE(vector4 W) { MOVETO(Distort(W,( .5, .5)))
LINETO(Distort(W,(-.5, .5))) LINETO(Distort(W,(-.5,-.5))) LINETO(Distort(W,( .5,-.5))) CLOSEPOLY() FILL[a -.1] STROKE(W[3]/25,CF::RoundJoin)[h 60]
}
// The Position of your Worldstate //———————————– vector2 WP(vector4 W,vector2 P)
let(Xw=W;Yw=W;Rw=W;Sw=W¶ ↑
;Xp=P[0];Yp=P[1] ;(Sw*(cos(Rw)*Xp-sin(Rw)*Yp)+Xw ,Sw*(sin(Rw)*Xp+cos(Rw)*Yp)+Yw ))
// Adjustment (x y r s) of Worldstate //———————————– vector4 WA(vector4 W,vector4 A)
(WP(W,A),W+A,W*A)¶ ↑
// Wavelike distortion //———————————– vector2 Distort(vector4 W,vector2 P)
let(xy=WP(W,P);X=xy;Y=xy¶ ↑
;(X+.08*sin(540*(2*X+Y)) ,Y+.04*sin(720*(X-2*Y)) ))