Yet yet another cube


I made a huge mistake on the last post, Yet another cube. In that post, I attached a quick-n-dirty implementation of dojox.gfx3d that work in Firefox only. Unfortunately, no source code is attached except gfx3d.js and a symbol link to my home directory. I untared the tar ball, and it worked, of course it just linked to my working copy! Here is the current snapshot.

In this implementation, I took the lazy evaluation, thanks to Eugene’s advice:

Once a 3D object is created in dojox.gfx3d.Viewport, only meta is recorded. The real DOM node is not constructed till the last minute, when dojox.gfx3d.render is called. That simplify the development and eliminate the dependencies of SVG and VML renders under the hood.

Cube in Firefox and MSIE
Cube in Firefox and MSIE

Above is screenshot in Firefox 2.0 and MSIE 6.0, you can see the inconsistences of the coordination system, we would fix that later. And here are more to consider:

  • Scene support so we can apply the world transform in a group of objects
  • Texture support: solid and gradient for more sophisticated texture
  • Z-order

Once we solve these problem, the next step is just to propagate it to other more complicated objects.