This chapter provides a detailed definition of the macro-command syntax together with a description of variable definition. A few sample expressions are then provided in order to illustrate the use of variables in attribute values. The following topics are covered by this chapter:
Macro-Commands are used to for an economical description of repetitive scenes (repeat and test commands).
Parameters are static variables used at compile time and indirectly controlled by macro-commands or directly modified through the set command.
Variables are declared through the scalar, table, and matrix elements. They can be modified at run-time through the set_node_scalar_value, set_node_table_value, and set_node_matrix_value. script commands.
<matrix> ‐ An element for the definition of matrix variables
The <matrix> element is used to define a matrix value attached to a node in a scene graph. The matrix element must be located inside a node.
The string value of the type attribute is equal to int in the case of an integer matrix, It is equal to float in the case of a float matrix, and equal to string in the case of a string matrix.
The integer values l and c of the sizeLine and sizeCol attributes define the dimensions of the matrix.
The initial value of the matrix is defined by the value of the value attribute. This value must have the type of the matrix as defined by the type attribute. This value is a list of l × c values surrounded by parentheses and separated by commas. If the integer value i of the index attribute is provided, the value is a scalar value corresponding to the ith element of the matrix. (Matrices are linearized line after line.)
None.
The following example, defines the float matrix named mat33. The matrix has 3 lines and 3 columns that are all filled by 10.0:
<matrix id="mat33" type="float" sizeLine="3" sizeCol="3" value="(10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0)" />