Canvas 3D Renderer Tweaked

Written by on March 2nd, 2007 in Ajax News.

Hans Schmucker has updated his Canvas 3D Renderer with new sample data, a few performance tweaks, background image support, support for colored polygons and a few other tweaks here and there.

The car you see is not a sprite, it’s simply an image put in front of the canvas for my amusement. Right now the sample data has around 200 faces and while the code is almost ready for shared vertices (which means that one vertex belongs to many faces, resulting in a much lower number of vertices in memory and therefore a lot less calculations) right now a face still consists of 3 vertices, meaning that it does about 500-600 rotations, projections, clipping and collision tests per frame update, with very few optimizations so far and for that the speed is (at least in my opinion) amazing.

Hans informally tested in a few browsers and had some feedback:

Opera 9.1 is definitely the slowest one, but with a very steady framerate, which probably means that drawing and garbage collection are very fast (as these tend to take up a variable amount of time), but arithmetic is slow.

Firefox 2 is pretty steady as well, and a lot faster than Opera.

Firefox 3 Alpha is certainly the fastest browser, but with a very unsteady framerate. I guess the new garbage collector is causing this while drawing speed is increasing thanks to Cairo.

Canvas Car

Source: Ajaxian
Original Article: http://ajaxian.com/archives/canvas-3d-renderer-tweaked

Leave a Reply

You must be logged in to post a comment.



Site Navigation