peter nitsch.net

peternitsch.net

Javascript demo competitions

I’ll admit to being one of those people that, until recently, considered Javascript to be substandard and barely a “real” programming language. My opinion began to shift with the rapid advancement of JS engines like V8 and introduction of powerful HTML5 API’s like Canvas and WebGL. I find myself playing more and more in JS and utilizing my Java/AS knowledge to build experiments. Recently, there has been quite a bit of buzz surrounding Javascript size competitions like JS1k and 10K Apart. JS1k alone has hundreds of quality entries. Of course the cynical Flash developer in me wants play down the excitement of these competitions. After all, very similar results have been produced in even stricter Flash contests for years (look at what @piXelero did in just 140 characters). But we’re talking about frickin Javascript here, and the new plugin-less API’s really are something to get excited about, so count me in.

JS1k only allows one entry, so I had to omit earlier attempts. The first was a Roguelike game that I couldn’t compress enough (best result was 1.35k). The second attempt was a 3D Lorenz attractor which evolved into my actual submission, a 3D twisty Sierpinski Gasket. I used several hacks to fit the entry under 1k, but most of the compression was done in Google’s Closure Compiler.

Update: I’ve implemented the gasket in WebGL as an experiment. The result is amazing, with a cloud of over 1 million points (10 iterations) and a much better FPS.

Exploring a Mandelbox with WebGL

WebGL Mandelbox Explorer

Note: This demo requires a WebGL capable browser. Installation instructions can be found at Learning WebGL or the WebGL Wiki.

This weekend I put the finishing touches on a WebGL Mandelbox explorer I’ve been tinkering with for the past week or so. If you’re interested in the mathematics, Tom Lowes who wrote the Mandelbox formula does a good job explaining it in detail on his site. I’ve been captivated with the pattern ever since watching Krzysztof Marczak’s amazing Mandelbox trip on YouTube (a must-see).

Read the rest of this entry »

Passing webcam data into WebGL via Flash

Note: To view the demos, you will need to have a WebGL capable browser plus the latest Flash Player (with webcam enabled in your Flash settings). I advise people to download Firefox 4.0 beta, enter “about:config” in the address bar, and change “webgl.enabled_for_all_sites” to true.

I tend to stay away from the HTML5 vs Flash “debate”, principally because I think it’s inane. Both platforms offer certain advantages over the other and some interesting results can be achieved by utilizing their strengths. Case in point, Flash’s built-in webcam support and WebGL’s hardware-accelerated 3D graphics are features that only exist in their respective platforms (for now). Bridging the technologies produces something unattainable by only using one, as the following quick examples illustrate.

WebGLcam
Simple interactive cube.

Read the rest of this entry »

HTML5 canvas pixel manipulation

liquid-javascript

Check it out!
view source

In an effort to explore some of the emerging interactive development environments, I decided to look at the canvas element at a deeper level. When the tag first debuted, I mucked about with some basic bitmap operations to get a feel for it, but nothing significant. Recently, the modern browsers have begun to demonstrate much faster JS engines, and this warranted a closer look. I’m fortunate enough to know Christopher Emirzian, whom allowed me to port his fantastic liquidjava experiment. We both thought it’d perform significantly worse than the result. Of course there are still several bugs, but Javascript is proving to be much faster than expected. Perhaps Mr.doob is actually onto something!

Speaking at Notacon 7

Blockparty Invitation

If you’re in or around Cleveland next weekend stop by Notacon, an annual hacker conference with a creative twist. In their words, it “explores and showcases technologies, philosophy and creativity often overlooked at many hacker cons”. I’ll be giving a talk about my experimental work in Flash with a focus on Alchemy. Notacon is also the venue for Blockparty, a North American demo party organized by Jason Scott and Christian Wirth (RaD-Man). I worked with Jac from Evoflash and musician Coda to build this years invitation for the party. Should be a great time!

Check out the invitation.
Note: All effects are real-time, so this is best viewed using the latest build of Flash Player 10.1.