[ Back to Geeks3D.com ]
 GeeXLab
Laboratory for Real Time 3D Programming (prototyping and demos) OpenGL, Lua, Python, GLSL, PhysX and more...Reference Guide XML Nodes
» Back to homepage
» Back to Developer's Guide Index
<motionpath> XML Node
<motionpath
name=""
num_segments_per_patch="1000"
display_keyframe_index="FALSE"
>
<keyframe
>
<key
x="0.0"
y="0.0"
z="0.0"
>
</key>
<tangent
x="0.0"
y="0.0"
z="0.0"
>
</tangent>
</keyframe>
</motionpath>
<motionpath>
The motion_path is a space curve which describes a trajectory that objects
will follow. This curve is governed by the Bezier 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
and a tangent which makes allows to locally model the curve.
motionpath element has 3 attributes and 1 sub-element(s)
- name [STRING]: Name of motionpath
- num_segments_per_patch [INTEGER]: specifies the number of segments for each Bezier path.
The bigger is this number of segments,the softer will be the animation (or displacement) along the curve - default value: 1000 - Default value = 1000
- display_keyframe_index [STRING]: 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 - Default value = FALSE
:
<motion_path name="curve01" num_segments_per_patch="2000">
<keyframe>
<key x="-50.0000" y="0.0000" z="0.0000" />
<tangent x="-60.0000" y="0.0000" z="50.0000" />
</keyframe>
<keyframe>
<key x="50.0000" y="0.0000" z="0.0000" />
<tangent x="60.0000" y="0.0000" z="50.0000" />
</keyframe>
</motion_path>
<keyframe>
keyframe makes it possible to create subnodes for each keyframe.
keyframe element has 0 attributes and 2 sub-element(s)
<key>
key specifies the position of the keyframe in the 3d scene.
key element has 3 attributes and 0 sub-element(s)
- x [REAL]: X coordinate of position. - Default value = 0.0
- y [REAL]: Y coordinate of position. - Default value = 0.0
- z [REAL]: Z coordinate of position. - Default value = 0.0
<tangent>
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)
tangent element has 3 attributes and 0 sub-element(s)
- x [REAL]: X coordinate of position. - Default value = 0.0
- y [REAL]: Y coordinate of position. - Default value = 0.0
- z [REAL]: Z coordinate of position. - Default value = 0.0
|