Virtual Choreographer Reference Guide (version 1.4) | ||
---|---|---|
Prev | Chapter 4. VC Macro-Commands, parameters, and variables | Next |
<scalar> ‐ An element for the definition of scalar variables
The <scalar> element is used to define a scalar value attached to a node in a scene graph. The scalar element must be located inside a node.
The string value of the type attribute is equal to int in the case of an integer scalar, It is equal to float in the case of a float scalar, and equal to string in the case of a string scalar.
The initial value of the scalar is defined by the value of the value attribute. This value must have the type of the scalar as defined by the type attribute.
If the tag has xlink:href attribute, the initial value of the scalar is copied from a file. The external file reference, given by the the URI reference (Uniform Resource Identifier), contains the initial value.
None.
The following example, defines the scalar named initialSite. Its first value is a random integer between 1 and {#nbBirds}:
<node id="birdPath_{#n}"> <scalar id="initialSite" type="int" value="(rand(1,({#nbBirds}+0.9999)))" /> <transformation id="transformation_birdPath_{#n}" geometry="path-transformation" size="1" with_roll="true">