Chapter 4. VC Macro-Commands, parameters, and variables

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:

4.1. Matrix (element)

<matrix> ‐ An element for the definition of matrix variables

4.1.1. Attributes

NameTypeDefaults
idSTRINGNone (required)
typeSTRINGfloat
sizeLineINTEGERNone (required)
sizeColINTEGERNone (required)
valueINTEGER LIST(0,0,...,0)
valueFLOAT LIST(0.0,0.0,...,0.0)
valueSTRING LISTList of empty strings
indexINTEGERNone (optional)

4.1.2. Description

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.)

4.1.4. Example

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)" />