» Back To Index
The <motion_path> node
Function
The motion_path is a space curve which describes a trajectory
that objects will follow. This curve is, in the current version of Demoniak3D, governed by the
Bézier splines equations.
A motion_path is composed of an unspecified number of spatio-temporal points called keyframes.
To each keyframe corresponds a space position, a temporal value (not yet used in Hyperion) and a tangent which
makes allows to locally model the curve.
Demoniak3D is delivered with a 3D utility, the
3DCameraPathEditor, which allows to visually build
any number of motion-paths and to directly export them as ready to use XML codes:
General syntax
<motion_path
name=""
num_segments_per_patch="1000.0"
display_keyframe_index="TRUE" >
<keyframe>
<key
x="0.0"
y="0.0"
z="0.0" />
<tangent
x="0.0"
y="0.0"
z="0.0" />
</keyframe>
</motion_path>
motion_path element
motion_path is the xml tag that defines a motion_path node.
Attributes:
- name - [STR127] - name of the node. This name will make it possible to refer this node throughout
the XML script.
- num_segments_per_patch - [INTEGER] - specifies the number of segments for each Bézier path.
The bigger is this number of segments, the softer will be the animation (or displacement) along the curve - default value: 1000
- display_keyframe_index - [BOOLEAN] - displays (TRUE) or hides (FALSE) the keyframes index numbers.
The index of a keyframe is directly linked to the typing order of the keyframes in the xml code - default value: FALSE
keyframe element
keyframe makes it possible to create subnodes for each keyframe.
Syntax
<motion_path>
<keyframe>
<...>
<...>
</keyframe>
</motion_path_kf>
key element
key specifies the position of the keyframe in the 3d scene.
Attributes:
- x - [REAL] - X coordinate of the position - default value: 0.0
- y - [REAL] - Y coordinate of the position - default value: 0.0
- z - [REAL] - Z coordinate of the position - default value: 0.0
tangent element
tangent allows to specify the tangent vector to the curve at the keyframe position level.
The tangent vector is a half tangent and is obtained by calculating the difference between the position
of the keyframe and another position in space, precisely the one that is specified using this instruction.
When the rendering of the tangents is activated in an object node (with the display_motion_path_tangents
attribute of the gizmo for example) the half tangent which one specifies appears yellow (the other half tangent
is green).
Attributes:
- x - [REAL] - X coordinate of the position - default value: 0.0
- y - [REAL] - Y coordinate of the position - default value: 0.0
- z - [REAL] - Z coordinate of the position - default value: 0.0