2009
07.10

So, I’ve decided to start updating this blog again. As you may notice, things have changed, as this blog will no longer serve to record my experience dealing with the RIAA, but instead be a place for me to show off what I’m working on. Whether or not anyone actually reads this doesn’t matter, since I’m mostly using it to organize what I’m doing and show off some of my projects to my friends. Hopefully, I’ll stay dedicated to updating this and it will grow to be a meaningful log of cool things I’ve made. If you’re still looking for the RIAA story, it’s not going anywhere.

Recently, I’ve been experimenting with drawing graphics using Javascript. I’ve been programming Flash for some time now, so I’ve experienced the fun of graphically intense apps in the web browser already, but I really wanted to break out of the plugin and see what you can do inside of a web page just in Javascript, and how fast you can make it.

I’ve made two demos, neither of which are finished, but I’ll show off links to them anyway.

The first will eventually become the new homepage of my site, that links to my blog, replacing the white vacuous page that currently is there. It’s Wolfram cellular automata generator, that picks random rules and random states and displays them, changing rules occasionally, or when the action gets repetitive. You can see a demo of it here. Eventually, I want to add support for the other kind of cellular automaton we studied, and maybe make it a little interactive with regards to which rule is displayed. This project was inspired by a program I developed with a classmate for an Unconventional Computing class at school. That’s over here.

The second still needs a lot more work, but still is pretty enough to show off. It’s a port of a program I originally wrote in Java and OpenGL (JoGL), for a class I took at Smith College called Programming for the Interactive Arts. This program loads a SVG font (easily converted from a TrueType font using a utility like batik) and displays the poem “Jabberwocky” by Lewis Carroll word for word, tweening between each word. It looks fairly cool, and I learned a lot coding it, unfortunately it can get a little slow on some of the bigger words. Check it out.

While Javascript will never beat OpenGL in terms of speed, I think there are still a lot of optimizations I can make. First and foremost, it’s important to say that the tweening function eats up most of the time. The program starts for me in a couple seconds, which is pretty impressive, considering it’s downloading an XML document, parsing it, and generating vector points for about a hundred glyphs. The tweening algorithm I’m using now results in much prettier tweening than my first, more obvious solution, but has the disadvantage of being slow. One idea I had is to sneakily prerender each frame throughout the tween during the pause during which the word isn’t animated. Right now this is about a half a second, which could be enough to render ten frames of tweening between two words. I still have to implement this, of course.

There are a lot of other cool things I can do here as well, such as give the user the choice of fonts, color, tweening algorithm, and text to display. Also, there’s the practical issue of big words not fitting on the screen. =x But otherwise, I think this is ready for a little showing off. If you come across this blog and try it, I’d love to hear how it runs for you.

I’ll also eventually release the font rendering API under an LGPL license, once it’s mature enough.

My eventual goal for both of these projects is to take some meaningful benchmarks, and compare them to the running time of the programs I ported them from. I wonder if we’ll be seeing more games or animations in the future done entirely in JS.

3 comments so far

Add Your Comment