<bone> ‐ An bone used to define skinning through a subdivision (a mesh)
This element defines a bone that is used to build and animate skeletons and avatars. Subdivisions are used for skeleton skinning by associating vertices with bones through tabboneref and tabvertexbone tables. A skeleton is a hierarchical structure of bones connected by transformations (see figure Figure 5-3). The transformations are a translation and a rotation that define the position of the bone joint with respect to the parent bone and an animation transformation that defines the current animation of the bone.
For this reason, a bone must carry two types of node references.
The parent bone node reference is given by the xlink:href attribute. Its value defines the URI reference (Uniform Resource Identifier) of the parent bone node.
The joint node reference is given by the joint attribute. Its value defines the URI reference (Uniform Resource Identifier) of the joint node. (Any type of node can play this role.)
The float values of the x, y, and z attributes define the geometry of the bone. For usual skeletons, the joint associated with a children bone is translated by (x,y,z) in the parent bone coordinates.
The float values of the r, g, b, a, and width attributes define the color and the width of the triangles that will be displayed when drawing the bone.
None.
The example below defines a skeleton. The root of the skeleton is the Body bone. This bone is located with respect to the Body_jnt node. In the node coordinate system, a joint Leg_jnt is defined for the upper leg. The translation part of the transformation for this joint in the body coordinate system (0,3.5,0), named Body_fwd, corresponds to the vector that defines the geomtry of the Body bone. The same construction is used to define the shin joint in the upper leg coordinate system.
<node id="Body_position"> <transformation id="Body_position" geometry="quaternion" w="0.0" x="0.0" y="0.0" z="1.0" /> <node id="Body_jnt"> <point id="Body_jnt" size="0.3" x="0.0" y="0.0" z="0.0" /> </node> <node id="Body_animation"> <interpolator id="Body_animation" type="transformation" size="2" > <schedule begin="10000" dur="1" mode="sinus" fill="freeze" ini="1" end="2" repeatCount="1" /> <transformation id="Body_rotation_ini" geometry="quaternion" w="1.0" x="0.0" y="0.0" z="0.0" /> <transformation id="Body_rotation_end" geometry="quaternion" w="1.0" x="0.0" y="0.0" z="0.0" /> </interpolator> <node id="Body"> <bone id="Body" r="0.6" g="0.6" b="0.6" a="1.0" width="0.1" joint="#Body_jnt" x="0.0" y="3.5" z="0.0" /> </node> <!-- Leg --> <node id="Body_fwd"> <transformation id="Body_fwd" geometry="translation" x="0.0" y="3.5" z="0.0" /> <!-- Leg position --> <node id="Leg_position"> <transformation id="Leg_position" geometry="quaternion" w="0.9964" x="0.0" y="0.0" z="-0.0848" /> <node id="Leg_jnt"> <point id="Leg_jnt" size="0.3" x="0.0" y="0.0" z="0.0" /> </node> <!-- Leg animation --> <node id="Leg_animation"> <interpolator id="Leg_animation" type="transformation" size="2" > <schedule begin="10000" dur="1" mode="sinus" fill="freeze" ini="1" end="2" repeatCount="1" /> <transformation id="Leg_animation_ini" geometry="quaternion" w="1.0" x="0.0" y="0.0" z="0.0" /> <transformation id="Leg_animation_end" geometry="quaternion" w="1.0" x="0.0" y="0.0" z="0.0" /> </interpolator> <node id="Leg"> <bone id="Leg" r="0.6" g="0.0" b="0.6" a="1.0" width="0.1" xlink:href="#Body" joint="#Leg_jnt" x="0.0" y="3.5511" z="0.0" /> </node> <!-- Shin --> <node id="Leg_fwd"> <transformation id="Leg_fwd" geometry="translation" x="0.0" y="3.5511" z="0.0" /> <!-- shin orientation --> <node id="shin_position"> <transformation id="shin_position" geometry="quaternion" w="0.9964" x="0.0" y="0.0" z="0.0848" /> <node id="shin_jnt"> <point id="shin_jnt" size="0.3" x="0.0" y="0.0" z="0.0" /> </node> <!-- shin animation --> <node id="shin_animation"> <interpolator id="shin_animation" type="transformation" size="2" > <schedule begin="10000" dur="1" mode="sinus" fill="freeze" ini="1" end="2" repeatCount="1" /> <transformation id="shin_animation_ini" geometry="quaternion" w="1.0" x="0.0" y="0.0" z="0.0" /> <transformation id="shin_animation_end" geometry="quaternion" w="1.0" x="0.0" y="0.0" z="0.0" /> </interpolator> <node id="shin"> <bone id="shin" r="0.6" g="0.6" b="0.0" a="1.0" width="0.1" xlink:href="#Leg" joint="#shin_jnt" x="0.0" y="1.8" z="0.0" /> </node> </node> </node> </node> </node> </node> </node> </node> </node>