The layer and color elements may be contained directly within the <scene> element, within a scene object element, or inside each other (color inside layer, or layer inside color):
<layer number="x"> ... </layer>
, unless overriden by another layer element. The default layer, used when no layer tag is present, is layer 1.<color r="R" g="G" b="B"> ... </color>
.See External blocks for more information about external.
... <external> <!-- any well-formed XML --> </external>
...
<include file="source_file">
<inject at="injection_path"> <!-- optional -->
<!-- any number of object definitions, includes or external tags are allowed here -->
</inject>
...
<inject at="injection_path">
...
</inject>
</include>
The inject tags are optional. Aside from the inject tag, external tags are also allowed inside include elements.
For more information about include injection, see Injecting data in included files.
The definition of an object of any type can contain the following tags, which must come in the order they are specified here. None of these elements are required.
<name> ... </name>
<sphere>-element might yield an object named sphere5.<meta_name> ... </meta_name>
<opacity absolute="x">a</opacity>
x must be true or false, where false is the default. a is a number in the interval
specifying the object's absolute opacity, or its opacity relative its parent node.<hidden/>
<transform> ... </transform>
<children> ... </children>
Inside the transform element, any of the following elements may appear in any order (they will be applied in the order they appear):
<translate system="s"> x y z </translate>
parent, world (the root of the scene file) or local, where world is the default.<rotate> ... </rotate>
<axis system="s"> x y z </axis>
<translate> element. The default value is (1, 0, 0) and world coordinates.<pivot system="s"> x y z </pivot>
<radians> r </radians> or <degrees> d </degrees>
<transform>
<translate>0 0 1.2</translate>
<rotate>
<axis>0 1 0</axis>
<degrees>45</degrees>
</rotate>
</transform>The matrix element, specified with the syntax given below, loads a transformation matrix, describing the object's transformation in the given coordinate system s.
<matrix system="s"> x1 x2 x3 x4 y1 y2 y3 y4 z1 z2 z3 z4 0 0 0 1 </matrix>
world or parent, where the latter is the default. The first, second and third column vectors represent the x-, y- and z-axis respectively. The fourth column vector is the translation relative the coordinate system's origin.
.Most objects (geometric primitives, mostly) allow adjusting the scale along the local axes using the <scale>-element.
<scale>x y z</scale>
For primitives comprised of lines (line clouds, grids, etc.) the width and the pattern of the lines can be changed.
The line style parameters are optional and the default is solid lines of width one.
<line_width>w</line_width> <line_style factor="x">solid|dashed|dotted|dash-dot|dash-dot-dot</line_style> <!-- x = 1,2,... -->
Camera object declarations may contain the following properties in addition to those common to all scene objets:
<orthographic/>
<fov> <degrees>d</degrees> OR <radians>d</radians> </fov>
degrees.Prodives a way to group similar objects without adding new graphical elements to the scene.
<group> ... <children>...</children> </group>
The sphere, cylinder, cube and circle elements are all scalable objects. Except for the optional scale parameters, neither of them add any extra markup.
<sphere>
<children>
<cylinder>
<scale>0.5 0.5 2</scale> <!-- diameter=1, height=2 -->
</cylinder>
</children>
</sphere>The point-cloud, line-cloud, polyline and polygon objects share a few important traits: they're are all scalable and their geometry is defined by vertices.
The <vertices> element is used to specify which vertices the object is comprised of:
<vertices> <vertex>x1 y1 z1</vertex> <vertex>x2 y2 z2</vertex> ... </vertices>
N vertices yields N points for a point cloud, N/2 lines a line cloud, an open polygonal chain with N-1 lines for a polyline and a closed polygon with N sides for a polygon.
Tri-meshes are specified through a set of vertices, just like polygons and line clouds, but also require a sequence of index triplets which define which vertices that should form triangles. The syntax for specifying the vertices is the same as for polygons.
The <triangles> element is used to specify which vertices to connect together into triangles:
<triangles> <vertex>index-1 index-2 index-3</vertex> <vertex>index-1 index-2 index-3</vertex> ... </triangles>
The indices are zero-indexed.
Models are scalable and require one additional element to be present:
<file> ... </file>
<file> tag specifies which model file to use. See the tutorial for information on which locations peekabot searches for models in. See the section on model conversion for information on which model formats that are supported by peekabot.<grid>
...
<type> regular|radial|angular </type> <!-- optional, default: regular -->
<segments> X </segments> <!-- required, X must be an integer larger than 0 -->
<central_angle> <!-- optional, default: 360 degrees -->
<degrees>Y</degrees>
OR
<radians>Y</radians>
</central_angle>
</grid>The grid type is specified with the <type> element and defaults to regular if the type element is left out.
Common to all grid types is that the number of segements in the grid must be specified somehow, more specifically, using the <segments> element. A regular grid with 10 segments will have 10*10 = 100 grid elements and a radial grid with 10 segments will consist of 10 concentric circular segments.
The optional <central_angle> element determines how far radial and angular grids extend - it has no effect on regular grids. If left out, it defaults to 360 degrees.
<!-- A 10x10 m cartesian grid with a resolution of 10 cm --> <grid> <scale>0.1 0.1 0.1</scale> <segments>100</segments> </grid>
<!-- An 8 m radius radial grid with a resolution of 1 m --> <grid> <type>radial</type> <segments>8</segments> </grid>
<!-- An 8 m radius angular, 180 degree grid with 10 degree resolution -->
<grid>
<scale>8 8 8</scale>
<type>angular</type>
<segments>18</segments>
<central_angle>
<degrees>180</degrees>
</central_angle>
</grid><label> ... <text>label text</text> <!-- optional --> <align>left | right | center</align> <!-- optional --> </label>
By default, labels are left-aligned and empty.
All joint types have a few common properties:
<min> element. <max> element. <initial> element. <offset> element.The joint value offset should be used if the configuration of the joint in the definition file is not the zero configuration. E.g. if the configuration of a 3-DOF arm in the definition file corresponds to "0, -90, 0" the offset should be set to 0, -90 and 0 for the three joints respectively.
Hinges are a rotational joints that result in rotation in the plane perpendicular to the given rotational axis. All rotations are done about the specified pivot point.
<hinge>
...
<min>
<radians>a</radians> or <degrees>a</degrees>
</min>
<max>
<radians>b</radians> or <degrees>b</degrees>
</max>
<initial>
<radians>c</radians> or <degrees>c</degrees>
</initial>
<offset>
<radians>c</radians> or <degrees>c</degrees>
</offset>
<axis system="s">
x y z
</axis>
<pivot system="s">
x y z
</pivot>
</hinge>local, parent and world.The order of the elements is not relevant and all elements are optional. The defaults are listed below:
Sliders (also commonly called prismatic joints) provide translational DOFs, that move all child objects along the axis specified by the <axis> element.
<slider>
...
<min>a</min>
<max>b</max>
<initial>c</initial>
<offset>c</offset>
<axis system="s">
x y z
</axis>
</slider>local, parent and world.The order of the elements is not relevant and all elements are optional. The defaults are listed below:
1.7.1