Posted: 07:09am 07 Nov 2016 |
Copy link to clipboard |
 Print this post |
|
I have made a small program for use on a 320x240 pixels lcdpanel which make beautiful random "tiles". It is based on fractal theorie and it generates incredible images. I show no pictures just use the code and see for yourself. It is very short and gives amazingly detailed graphics. Have fun
'Made by H. Verbeek Netherlands 2016 'Based on TAGAKI mountain Do CLS xm=160:ym=120:a2=Rnd:c=Rnd*20:m=6:n=120:rn=Rnd*150 For i=0 To n For j=0 To i x=i/n y=j/n z=1-x For k=0 To m x1=2^k*x-Int(2^k*x)*rn y1=2^k*y-Int(2^k*y)*rn f=Sin(Pi*x1)*Cos(Pi*y1) z=z+a2^k*f Next k col=Int(c*z And 4)*4177920+Int(c*z And 2)*32640+Int(c*z And 1)*254 Pixel xm+i,ym+j,col:Pixel xm-i,ym+j,col:Pixel xm-i,ym-j,col:Pixel xm+i,ym-J,col Pixel xm+J,ym+I,col:Pixel xm-j,ym+i,col:Pixel xm-j,ym-i,col:Pixel xm+j,ym-i,col Next j Next i Loop |