Mathematical '3D' graphics in SVG and <canvas>

There is no web standard markup language for 3D graphics. The XML application X3D is a markup language for 3D graphics, but not (yet?) a standard for the web and not natively supported by any browser. A 2D projection of a 3D structure can be included in a web document as an image in raster or SVG format, or by "drawing" it on a <canvas>. An author could construct a 3D digital graphic in some application, like a CAD application, and have it output a 2D projection image in raster or SVG.

2D projections of 3D figures constructed on a <canvas>.

View the JavaScript in the source code of this page to see how figure 1 is made, and see this explanation for more information on orthogonal projection.

A cube.
Fig.1.

Figure 2 shows the result of plotting a 3D function on a <canvas>.

3D function.
Fig.2.

A 2D projection of a 3D figure in SVG.

Obtained by simply delineating figure 1 by hand in Inkscape.

A cube.
Fig.2. cube.png