JS1K

Here are three of my entries for the 1K javascript contest. The goal is to make the most interesting demo in under 1024 bytes of javascript.

953 Bytes
JS1k - 3D Computer
A rotating 3D Computer
http://js1k.com/2010-first/details/594
948 Bytes
JS1k - Firecube
A rotating wireframe cube on Fire
http://js1k.com/2010-first/details/76
881 Bytes
Untitled-2
10 Pixel Deformations
http://js1k.com/2010-first/details/673

3D Model

The 3D Model was created in 3D Studio Max 9 then exported to wavefront OBJ format. Quads were used in favor of triangles to reduce the number of vertices. The 3D model was then tweaked to occupy as many whole numbers as possible then manually compressed using ASCII reference table. I left out the mouse for savings. Download the 3D Model here

4930263977_4a0e459905_o

SVG Alternative

I originally planned the 3D model to be a dataURI base64 encoded compressed SVG(z). The GZIP compression got it down to 690 bytes, unfortunately attempts to integrate it into the JS1k template failed:

  • I tried base64 encoding the GZIPed SVG, but dataURI does not support content-encoding so thats a bust. (only works in Opera)
  • I tried putting the SVG inside a getURL via flash actionscript (for it’s flash compression), but security permissions do not allow getURL to dataURI from another dataURI, unless I dynamically embed it with allowAccess attributes, but there goes my bytes.

Here is early an prototype of a 700 byte SWF file containing SVG versionhttp://luis.net/projects/1k/3d/computer.swf