The format of the 3D part of the path_ology library is as follows:

<svg ...>
SVG commands
<metadata>
  <scenes>
     Global variables
    <objbg transform="translate(0,0,-300)">...</objbg>
    <scene id="st1">
      <perspective>...</perspective>
      <objfg transform="translate(-145,-64,80) roty(45)">
        <obj class="wdm3" href="wdm01" transform="rotz(60)" />
      </objfg>
    </scene>
    <scene id="st2">....</scene>    
    <objbgafter transform="rotx(90)">...</objbgafter>
  </scenes>
</metadata>

<defs>
<path id="mt01"  d="M-2000,-494v494h4000v-494z"/>
...
</defs>
SVG commands
</svg>

The metadata element contains the sequence of scene definitions that define the keyframes of the animation. Before the scene definitions is some global information such as how long the animation will last. This is followed by one or more objbg elements that are rendered on each scene. At the end of the scene definitions is one or more objbgafter elements that define information that is rendered on each scene after the scene information is rendered. Each scene definition defines the perspective transformation to apply to that scene followed by a sequence of objfg elements. 3D transformations can be defined for each objfg element and also for the individual obj elements that make up the objfg element.

Each object defined by an obj element referes to a path description defined in the defs section. The simplest descriptions consist of standard 2D path elements. These each have a z=0 coordinate added to them. The basic SVG path definitions have been augmented with two additional ways of defining 3D paths:

  • path3d: almost the same as the current path element except each position has a z-coordinate as well as an x- and y-coordinate
  • point and p_path3d: allows a set of 3D points to be defined. The 3d paths are then defined by reference to these points. The main use for this form is where objects are highly structured and the same point is used several times. For example, the vertex of a cube is used in the definition of 3 faces. This representation ensures that a change to a point's position will be reflected in all the uses of that point.

Subsequent pages will describe each section in more detail.