The If Works This dirt was a building before

What are you doing with Sylvester?

Apparently some people are actually using Sylvester. Which comes as something of a surprise to me because I’ve had nobody (until today) email me or comment here about it at any length. It initially came out seven or eight months ago, and while I intented it to be a full 3D rendering environment, my day job took over more and more of my time and it never got beyond being a maths framework. Truth be told, I knew pretty much nothing about 3D rendering when I started (and that largely remains true), but I’d seen other people write 3D engines in JavaScript and wanted to learn (and I wanted to write something that wasn’t riddled with dozens of global functions). And, though it’s so far not fulfilled the ambitions I initially had for it, writing it has taught me a great deal about JavaScript performance.

Recently though, there’s been signs of OpenGL-backed 3D environments coming to various browsers, and however good a job I make of writing a 3D engine, it will never perform as well as native browser code. I still think it’s worth fleshing out the maths capabilities of the framework, though — there are various features I was working on for version 0.2 that have never seen the light of day. Stuff like line segments, polygons, and various useful algorithms for dealing with them. I’d be interested to know whether people would be interested in me finishing these features, and whether I should still push for a 3D rendering engine. So if you’re using Sylvester for any project, large or small, do get in touch and let me know what you think of it and how it should be improved.


8 Comments

Hey James,

I’ve used Sylvester in some Canvas 3D demos — see http://blog.vlad1.com/2007/11/26/canvas-3d-gl-power-web-style/ — and it’s worked out quite well for me as-is. I added a few helper functions to get matrices out in slightly different object layouts, but no issues other than that. Unfortunately I haven’t had time to do much C3D-related work for a while, but I hope to get back to it soon.

I disagree with you that a 3D engine written in JavaScript will never perform as well as native code, though; if you have access to native 3D acceleration (through OpenGL or a similar API), you should eventually be able to get very close to native performance with a good enough JS JIT/interpreter. Conveniently, Mozilla’s working on such a beast as part of the Tamarin/ES4 work. :)

Posted by Vladimir Vukicevic on 3 January 2008 @ 9am

James,

I’m working on using Sylvester with Silverlight 1.0. Any further improvements you do would be much appreciated!

Posted by Chris Cavanagh on 11 January 2008 @ 5am

I’ve enjoyed this package as well :)

Posted by Michael Deal on 14 March 2008 @ 9am

i’m thinking of implementing Kass and Miller’s 1991 paper “Rapid, Stable Fluid Dynamics for Computer Graphics” in javascript, and i’ve finally tired of one-offing my vector routines for every little app, so i’ll be looking at Sylvester. especially since the paper deals with an arbitrary nxn matrix. hmm, although it only has values in the main diagonal and the two adjacent diagonals, so custom code is probably called for anyhow.

i was wondering if sylvester is optimized at all for the common matrix sizes: 2×2, 3×3, and 4×4. while nxm is certainly nice to have available, making those base cases speedy would be nice as well.

Posted by orion elenzil on 20 November 2008 @ 12am

It’s always nice to find a sensibly implemented package for numerics in another, popular language. There are just too few of them out there. That’s why quant wonks like me tend towards R or even C because there are well-vetted libraries.

In my case, Sylvester is being tried as a means of implementing spatial algorithms designed in and for R in ActionScript, often supporting displays and the like.

Posted by Jan Theodore Galkowski on 3 March 2009 @ 9pm

What would be really cool is if the Matrix class had methods for SVD and QR decomposition as well.

I may take that on, but I can’t promise any kind of schedule.

Posted by Jan Theodore Galkowski on 4 March 2009 @ 3pm

I have been using Sylvester do make CSS3 transform property work in Internet Explorer 6+ like it does in the other top browsers. Sylvester has really shortened the amount of development work and I thank you.

If you are interested in the result of my work, please see my article, Cross Browser CSS Transforms – even in IE.

Posted by Zoltan Hawryluk on 9 March 2010 @ 11am

I’m considering to use sylvester to write a js library to manipulate astronomic fits images and to build a fits image viewer/reduction web based software. Thanks for your work!

Posted by Lanza (nextime) Franco on 3 June 2010 @ 10pm

Leave a Comment