3d rendering on a HTML5 canvas