Join for FREE | Take the Tour Lost Password?
[x]

deviantART

 
©2007-2009 =Roxor128
:iconroxor128:

Artist's Comments

You can't really call this an animation as it's really more of a program. I wrote the original in C++ under DOS a few years back and in the space of around eight hours today, found out enough about Flash 8's ActionScript to port it to Flash.

On startup, the script generates a 256 colour pallete, sometimes known as a 332 pallete. The name comes from the fact that red and green get 3 bits and blue gets 2 in the indexing scheme. For a pallete that only contains 256 out of 16777216 colours, the 332 pallete does a pretty good job at displaying 24-bit images at 8-bit screen resoultions.

The main part of the script uses a very simple formula to get the results:

y = x ^ t;

(^ is the bitwise exclusive-OR operator in many programming languages, C++ and ActionScript among them)

The value of t is incremented every iteration and different initial values for t produce slightly different results (a value of zero is used here). My original C++ program prompted you for the initial value of t at startup, but I can't figure out how to do that with Flash just yet (for all I know, it might not even be possible).

The original program ran at 320*200. This version runs internally at 256*144 and then blows up the pixels. While it is technically possible to run it at a higher resolution, the results don't look as good (mainly because everything ends up so small). Also, while it is possible to use a pallete with more entries, it takes too long to go through them and spoils the results. 256 entries are enough for this.

Comments


love 0 0 joy 0 0 wow 0 0 mad 0 0 sad 0 0 fear 0 0 neutral 0 0
:iconsmurfmx:
Very nice, great use of actionscript!

--
SupaShaD: sometimes i think im too stealthy for my own good
Smurf: she ask "is it in yet?" again?

Proud to have made a stripper cry.
:iconroxor128:
I guess this goes to show that programming can be art as well as science.

This script really emulates a low-resolution screen, only it uses an ActionScript class instead of a monitor for its display. The original program drew directly to the screen, while the script behind this draws to a buffer and then puts the contents onto the virtual screen.

I've got a few other ideas now that I've succeeded in porting this little program to Flash.

--
"Curiosity can spark a fire that should never be put out." - Rohan Bernett
:iconginkner:
Delicious. Source available?

--
"Don't die. Its bad for your health."-Me
"The status is NOT quo."-Dr.Horrible
:iconroxor128:
Actually, the artist's comments tell you all you need to know to write your own program like this.

--
"Curiosity can spark a fire that should never be put out." - Rohan Bernett

Details

February 14, 2007
535 bytes
11.0 KB
1024×576

Statistics

4
1 [who?]
174 (0 today)
13 (0 today)

Share

Link
Embed
Thumb

Site Map