DUCK.3JS.2K by Knox [web]
DUCK.3JS.2K by Knox / a_chevallier [at] yahoo [dot] com [23/01/2011] ============================================================================= Original version by Wurst (http://pouet.net/prod.php?which=52413) Tested on Firefox 3.6, Chrome 8, Opera 10, Safari 5. Don't bother trying this in Internet Explorer. + Re-encoding of the duck model, using triangle strips while preserving the order of the vertices. The raw 8-bit model data is now 1162 bytes long. + Size-optimization of some parts of the Javascript code. Re-write of some other parts to make them more "deflate-friendly". Added the triangle strips decoder. The updated JS is now 1503 bytes once minified. + Both the JS code and the model data are packed into a deflate string as the IDAT chunk of a grayscale PNG file. The duck model is compressed to about 78% and the JS code to 50%. The final deflate string is 1709 bytes long, which expands to 1766 bytes with the additional PNG file data. + Finally, added a small loader of 279 bytes for a final size of 1766 + 279 = 2045 bytes. The same <canvas> is used for decoding and drawing.
[ back to the prod ]