7.29. SetSubdivisionValues

set_subdivision_vertex_value ‐ Dynamic modification of subdivision vertices

set_subdivision_normal_value ‐ Dynamic modification of subdivision normals

set_subdivision_textureCoord_value ‐ Dynamic modification of subdivision textureCoords

set_subdivision_vertex_uniform_value ‐ Dynamic uniform modification of all the vertices in a subdivision

set_subdivision_normal_uniform_value ‐ Dynamic uniform modification of all the normals in a subdivision

set_subdivision_textureCoord_uniform_value ‐ Dynamic uniform modification of all the textureCoords in a subdivision

7.29.1. Attributes

NameTypeDefaults
indexINTEGERNone (required)
operatorSTRINGNone (required)

7.29.2. Description

These actions are used to modify the values associated with some of the geometrical components of a subdivision element. If the attribute values contain parenthesized expressions, they are dynamically evaluated as numerical expressions and their values are replaced in the attribute value strings.

The integer value object no of the index attribute defines the rank of the object in the list of objects of its type (vertices for set_subdivision_vertex_value, normals for set_subdivision_normal_value, and textureCoords for set_subdivision_textureCoord_value). Ranks begin at 1.

In the case of uniform modifications (set_subdivision_vertex_uniform_value, set_subdivision_normal_uniform_value, and set_subdivision_textureCoord_uniform_value) the action is applied to all the vertices, normals, or textureCoords in the subdivision.

The string value of the operator attribute is an operator string. The values of the operator must be "=", "=", "+=", "-=", "*=", or "/=". The child node is a vertex, a normal, or a textureCoord element that contains at least one attribute and its associated value.

The attributes of the child node are called source attributes. If the target node contains at least object no vertices, normals, or textureCoords depending on the selected action, the values of the source attributes are used to modify the values of the corresponding attributes in the object number object no of the target subdivision node.

For instance if the action is set_subdivision_vertex_value and if the child node is a vertex that contains the attribute x, and if the operator is "=", the source attribute value is used to instantiate the first coordinate of the target vertex (the vertex number object no). The other operators respectively correspond to addition, substraction, multiplication, and division of the target values by the source values. The attributes of the target object that are not instantiated in the source object (the child node) are not modified by this action.

7.29.3. Expected children

The following element must occur in set_subdivision_vertex_value, set_subdivision_normal_value, or set_subdivision_textureCoord_value: one vertex, one normal, or one textureCoord element.

7.29.4. Expected target

The target node must contain a subdivision element.

7.29.5. Example

The example below defines an action that increases the first coordinate of the second vertex by 0.01.

<set_subdivision_vertex_value index="2" operator="+=">
  <vertex x="0.01" />
</set_subdivision_vertex_value>

The example below defines an action that sets all the texture coordinates to (0,0).

<set_subdivision_textureCoord_uniform_value operator="=">
  <textureCoord u="0" v="0"/>
</set_subdivision_textureCoord_uniform_value>