hacks.mozilla.org

animating SVG with canvas and burst

Today’s demo is short, but it also includes a long screencast that describes how it’s put together. The demo’s author, Alistair MacDonald (@F1LT3R), is one of the maintainers of Processing.js and the Burst engine, which is the basis for today’s demo and tutorial.

If you haven’t clicked through to his site, I strongly suggest that you do so. You’ll notice that the site is animated and slick-looking with sections that slide in and out and lots of graphics. It’s the kind of thing that you normally would see written in flash, but there’s no flash on the main page. It’s all CSS, canvas and animation in the DOM. Pretty amazing.

On to the demo. There have been some demos done with animating SVG but there’s one thing that stands out about this one that makes it different. Instead of loading SVG natively into the DOM, which is how SVG was originally designed, the Burst engine loads the SVG, parses it and creates some JS objects around it which you can then use to render it to a canvas. From there you can quickly animate it with the Burst engine and mix it with other content on a canvas.

I also strongly suggest that you watch the tutorial on how this demo was put together. He shows how easy it is to take inkscape, the Burst engine and other simple JS to take a simple drawing and animate it. It’s worth the length of the video.

15 Responses to “animating SVG with canvas and burst”


  1. 1 Rick

    Very, very slick.

  2. 2 Anita

    Awesome, I am loving this 35 day series

  3. 3 Vance Dubberly

    Just finished up an animated SVG US Map. I’m really excited that SVG is finally getting decent implementation in at least a few browsers. I ended up using the dojo gfx toolkit because, well I use dojo and it has a library for this sort of thing but the idea is the same.

    Should be noted that inkscape is pretty darn buggy, btw. Also that while simple animations in SVG run pretty nicely the more complex the lower the “Framerate” and sadly it’s nowhere near as clean as flash.

  4. 4 Breton

    What exactly do you mean by “clean”?

  5. 5 Vance Dubberly

    @Breton sorry that was pretty ambiguous. Not a reference to the code or API. I’m referring to playback. Smoothness of animation. We’re on our way but just try to implement a particle system in svg or canvas… it’ll make ya cry.

  6. 6 soso

    Why do you not using smil for this stuff?
    OK, Firefox has no native smil support but fakesmile does the job.

  7. 7 Al
  8. 8 Al

    @Vance Dubberly: I found the new “real” version of Inkscape to run very, very well. I usually work with the pre-releases.

  1. 1 nitot's status on Thursday, 11-Jun-09 09:11:01 UTC - Identi.ca
  2. 2 Mozilla Firefox 3.5 Wissen für Entwickler » Suchmaschinen Blog
  3. 3 Ajaxian » Animating SVG with Canvas and Burst
  4. 4 Animating SVG with Canvas and Burst
  5. 5 audio player - HTML5 style at hacks.mozilla.org
  6. 6 颠覆网络35天 ─ HTML5范儿的音频播放器 < MJiA
  7. 7 谋智社区 » Blog Archives » 颠覆网络35天 ─ 使用Canvas和Burst制作SVG动画

Leave a Reply