Virtual Choreographer Reference Guide (version 1.4) | ||
---|---|---|
Prev | Chapter 4. VC Macro-Commands, parameters, and variables | Next |
<repeat> ‐ A repeat macro-command
The <repeat> macro-command is used at compile-time to copy several instances of the XML code contained between the opening <repeat> and closing </repeat> markups. Each repeat element is associated with a parameter that can be referenced in the strings and in the numerical expressions inside the scope of the <repeat> markup.
One of the following elements must occur in repeat element: node or use.
The following example shows two embedded <repeat> macro-commands and the use of their parameters n and k:
<repeat begin="0" end="12" step="1" id="n"> <node id="sea_{#n}"> <transformation id="transf{#n}" geometry="translation" x="(8 + ({#n} * 2))" y="0.0" z="0.0"/> <repeat begin="2" end="8" step="2" id="k"> <node id="sea_wave_{#n}.{#k}"> <transformation id="transf{#n}" geometry="translation" x="({#k} * 0.25)" y="0.0" z="0.0"/> <node id = "sail"> </node> </node> </repeat> </node> </repeat>