Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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


In reply to Balls! by teamster_jr

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (1)
As of 2024-04-25 00:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found