Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Balls! Pt 3

by teamster_jr (Curate)
on May 17, 2006 at 14:40 UTC ( #550028=obfuscated: print w/ replies, xml ) Need Help??

Apologies for posting two in a row.
just did this:
s''openZF," >o.bmp";printZF Zpack("a2V13",BM, 37686,0,54,40,112,11 2,1572865,0,37632),map {chr(($_%112-55)**2+($ _/112-55)**2<3025?255- 3*(($_/112-75)**2+($_% 112-75)**2)**.5:0)x3 }0..12544';s#\s##g ;s#Z# #g;eval
hope you like it.
al
updates:
As L~R mentions - check for o.bmp;
also i've gently obfuscated it - otherwise it probably didn't belong here!
I've reformatted it to fit my balls format - this one is another ball shorter! (see the others here and here)
(and renamed to fit in with my balls naming scheme!)
change L to V in pack to force little endianness - this should fix some viewers. (from londonpm email thread).

Comment on Balls! Pt 3
Download Code
Re: balls III
by Limbic~Region (Chancellor) on May 17, 2006 at 15:19 UTC
    teamster_jr,
    Very impressive but you might want to mention that you need to look at the outputted file (o.bmp) to see the results.

    Cheers - L~R

Re: Balls! Pt 3
by krisahoch (Deacon) on May 17, 2006 at 20:18 UTC
    ++ for the deft usage of your statement 'my balls', in multiple places.
Re: Balls! Pt 3
by TedPride (Priest) on May 17, 2006 at 20:34 UTC
    Neither my Picture Viewer or Photoshop can view the bmp. What's it supposed to look like?
      xv, firefox or ie should all work. ms paint seems a bit funny - i've probably got a data border or a header value wrong somewhere.
      alex
      ah! In a londonpm mailing list conversation someone pointed out it should be "V" not "L" in pack - force it into little endianness. The above post is updated.
      al
Re: Balls! Pt 3
by turo (Friar) on May 17, 2006 at 23:00 UTC

    did you use pov-ray to generate the sphere?

    very cool!

    perl -Te 'print map { chr((ord)-((10,20,2,7)[$i++])) } split //,"turo"'
Re: Balls! Pt 3
by QM (Vicar) on May 19, 2006 at 04:21 UTC
    ++

    Is it supposed to be wrapped around?

    -QM
    --
    Quantum Mechanics: The dreams stuff is made of

      no, it's not. I think i might have got one of the header values wrong - so the image data is read too far in - causing it to wrap.
      Or it may be an endian problem if it was run before i fixed that.
      alex
Re: Balls! Pt 3
by liverpole (Monsignor) on May 20, 2006 at 14:17 UTC
    Very cool!  I missed this when you posted it somehow, and just stumbled onto it now.

    teamstr_jr, you are the master of direct manipulation of file formats!


    s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/
Re: Balls! Pt 3
by wulvrine (Friar) on May 22, 2006 at 13:16 UTC
    ++ Nice job! Your ability to write code to directly generate graphical items never ceases to amaze me.

    s&&VALKYRIE &&& print $_^q|!4 =+;' *|

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: obfuscated [id://550028]
Approved by Limbic~Region
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (11)
As of 2014-11-20 21:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (101 votes), past polls