This chapter provides a detailed definition of the syntax and semantics of VC scene description language. VC markups divide into three categories: media objects, transformations, materials, and elements:
Media objects are the physical building blocs of a virtual scene: geometrical objects, lights, fog, viewpoints... Media objects are typically located at the leaf nodes of a scene graph.
Transformations define the spatial layout of the media objects in the virtual scene. Transformations are typically located at the non-terminal nodes of a scene graph.
Properties define the material, sonic or physical properties of media objects. They are used as parameters for real time or frame by frame rendering. Some of these properties depend on the application chosen to render the virtual scene, some of them are generic.
Elements are all the remaining markups that participate in the definition of a virtual scene in VC. They are building blocks used by the other scene components for their definitions.
<aliasScript> ‐ An alias script
This element is used to contain a script of commands triggered by input OSC messages made of an address and a list of parameters. The alias script is attached to the root node of a scene graph.
Alias script commands have no triggers since they are automatically triggered by OSC messages. For this purpose, alias script commands must all have a pattern attribute. The pattern value of the pattern attribute is a string that defines a filter for OSC commands. Only OSC commands that match the pattern string can trigger the corresponding script command.
The pattern value of the pattern attribute has the same syntax as an OSC command. (OSC commands are described in the udp_remote_client element.) Each pattern is made of:
An address: a string made of the contatenation of '/' characters followed by a sequence of alphanumerical characters. For instance, /here/and/now is a correct address.
A list of parameter types: parameter types are defined by 's' for strings, 'f' for floats, and 'i' for integers. For instance, s f f i is a list of four parameters: a string, two floats, and one integer, in this order. The values of the parameters of the matching OSC commands can be used in the actions that build up the corresponding command. they must be referenced by {$1}, {$2}, {$3}... and they must be embedded into parenthesized expressions in order to be evaluated. The index correspond to the rank of the parameter in the OSC command. In our case, {$1} refers to a string, {$2} and {$3} to a float, and {$4} to an integer.
This element expects a list of commands as child nodes.
In the example below, the alias script contains one command. The command is triggered by the reception of an OSC command made of the /rotateeye address and two parameters: one string and one float. The first action associated with this command modifies a rotation angle by accessing the value of the scalar angle of the node with the ID "({$1}) rotX" (where ({$1}) is the string value of the first parameter). The second action modifies a rotation angle by the value of its second parameter (a float). The node IDs of the targets of these two action are strings that are defined by using the string value of the first parameter.
<aliasScript> <command pattern="/rotateeye s f"> <action> <set_node_attribute_value operator="="> <transformation angle="({$({$1}) rotX:angle})" /> </set_node_attribute_value> <target type="single_node" value="#rotX ({$1}) 1" /> </action> <action> <set_node_attribute_value operator="="> <transformation angle="({$2})" /> </set_node_attribute_value> <target type="single_node" value="#rotX ({$1}) 2" /> </action> </command> </aliasScript>