svg


From the beginning, Lily has used Firefox's SVG capabilities for various shape primitive externals ("circle", "rect", etc) and to draw connections between objects, but until this weekend, it lacked a straightforward way to use SVG's capabilities for animation and graphics. To address this, I've added a new UI object, "svg" that provides a resizable SVG canvas to draw to. As an added bonus, the drawing API is compatible with the Processing API, meaning that "svg" can run most of the 2-D examples on the Processing site with minimal modification. "svg" drawing commands can be messages from other objects sent via connections or run from an external script file. It's also possible for an external script to define a method that can be called with parameters from an input message. Scripts can also output messages from outlets.

As you'd expect with a Javascript-based SVG implementation, there are some limitations- there's no 3-D yet (though this could be added), no support for OpenGL, no reading & writing pixels directly, etc. There are performance limits as well, though this really only becomes an issue for animations that need to manipulate hundreds (or thousands) of objects many times a second. And with Tarmarin on the way, this should become less of an issue. There are even a couple of advantages- there's no compilation, so programs can be switched in and out instantly at runtime, and unlike an applet, SVG is completely transparent and interoperable with the web page it's embedded in. "svg" will be included in Beta 4 which should be ready sometime in next month. Interested in testing? Let us know.


Comments (2)

Forgot to the mention that image in the screenshot is adapted from a program in Ira Greenberg's book Processing

Taichiro Yoshida:

Nice to meet you.
I'm Taichiro Yoshida, Japanese, Developer.
I have watched demo just now.
I think it's great and has huge potential.
Talk to you later.

About

This page contains a single entry from the blog posted on August 14, 2007 1:53 PM.

The previous post in this blog was Beta 3A.

The next post in this blog is Beta 4.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.34