5.81. Use (element)

<use> ‐ A node reference

5.81.1. Attributes

NameTypeDefaults
xlink:hrefURINone (required)

5.81.2. Description

This element references another element and indicates that the media contents of that element is included/rendered at that given node in the scene graph. Interpolators can also reference elements as interpolation generators. A use element has the same effect as if the referenced elements were replaced by the subgraph rooted in the referenced elements. The geometry is shared between all the coreferences to the same element. If the coreferences concern subgraphs, all the geometries in all the terminal nodes of the subgraphs are shared.

The external node reference, given by the xlink:href attribute, defines the URI reference (Uniform Resource Identifier) of the node.

5.81.3. Expected children

None.

5.81.4. Example

In the example below, an interpolator blends two external nodes named fish #1 and located in files named bib/P1_Bercy/fish1.xml and bib/P1_Bercy/fish2.xml. The source file is:


<node id="fish_interpolate">
   <interpolator id="fish_interpolate" type="node" size="5">
     <schedule begin="(-40+rand(0,5))" dur="1" repeatCount="1000" 
       mode="linear" fill="freeze"/>
     <use xlink:href="bib/P1_Bercy/fish1.xml:#fish #1" />
     <use xlink:href="bib/P1_Bercy/fish2.xml:#fish #1" />
   </interpolator>
</node>

File bib/P1_Bercy/fish1.xml contains:


<node id="fish_#1">
  <wave id="f#1" segments="10">
    <!-- description of a first ruled surface -->
  </wave>
</node>

and file bib/P1_Bercy/fish2.xml contains:


<node id="fish_#1">
  <wave id="f#1" segments="10">
    <!-- description of a second ruled surface -->
  </wave>
</node>

The rendering of the initial document is equivalent to the following document:


<node id="fish_interpolate">
   <interpolator id="fish_interpolate" type="node" size="5">
     <schedule begin="(-40+rand(0,5))" dur="1" repeatCount="1000" 
       mode="linear" fill="freeze"/>
     <node id="fish_#1">
       <wave id="f#1" segments="10">
         <!-- description of a first ruled surface -->
       </wave>
     </node>
     <node id="fish_#1">
       <wave id="f#1" segments="10">
         <!-- description of a second ruled surface -->
       </wave>
     </node>
   </interpolator>
</node>