Hi all,
I haven't posted anything of my own for a while.
Here's my latest effort: a vt100 obfu (sorry as ever to windows users...).
The bumpmap could do with rounding and the raytracing (!) routine isn't ideal, but i'm reasonably happy with it
- maybe i'll fix these problems for an updated version at some point.
Update: I've done a new version with a generated sphere and a better shading routine. it's
here.
The * at 0,0 is the lightsource.
$_=q%$_=" 88GGCI";
@a=/./g;@_=('IP ""YI','IjjjjI',
'IiciII') ;whil e($c=pop@ a){ma
p{$_=$c.$_ .$c}@_ ;@_=(($t=( $n=$a[
$#a]||"@").$ {c}x(- 2+length$_[0]).$n),@_,
$t)}$_='j8_4xj4,@@8b,x j2,@14bxjd@16bxd@18bx@
20x@20x@20xY@18PxjY@16 Pxj`Y@14Pxj4`@10Pxj8"5
x';s#(.)(\d*)#$1x($2|| 1)#eg;$m=2;$n=-1;$|=1;
$p=9;$q=20;{$q+=$n*= $q<11|$q>50?-1:1;$p+
=$m*=$p<8|$p>16?-1 :1;$u=-$q*6/($l=($
q**2+$p**2)**.5 );$v=-2-$p*6/$l;
$r=$p-6;$ s=$q-9;$y=0
;select$x
,$x,$x,.2*print
"\ec*",(m ap{$l
=0;"\e[".$ r++.";
${s}H",$y++<$v?$_:do{@
c=split//,$_[$y-$v-1];
map{$l++>$u&/@/&&($t=$
c[$l-$u-2])?$t:$_}/./g
},$/}splitjx),"\e[30
H";redo}%;s#\s##g;
s#j#$"#g;eval
enjoy.
alex
ps. i got the shape from
http://music.hyperreal.org/artists/b12/gallery/ascii/fl/sphere.htm
The result of searching (given my job i'm not going to say googling!) for ascii art.
Update: added link to updated code