DataMaterial

graphics/plugins_datamaterial-icon.png

DataMaterial changes the material parameters of the controlled container. The data can specify any combination of the ambient, diffuse, specular, emission and alpha parameters of the material.

The data format is:

[AMBIENT r g b] [DIFFUSE r g b] [SPECULAR r g b] [EMISSION r g b] [ALPHA a] 

This format can specify new values for separate material components.

  • [COLOR r g b]: specify a color using red green and blue values.

    Note: All color values (r g b) are numbers between 0 and 255. Alpha values are float numbers between 0 and 100.

  • [MATERIAL name]: specify a material name from the Viz material library.

    The message format is:

    MATERIAL MATERIAL*<name>

    where <name> Is the full path to a material in Viz material library.

graphics/plugins_datamaterial.png
Example
  • If the received data is

    MAT[0-3]=DIFFUSE 255 0 0, DIFFUSE 0 255 0, DIFFUSE 0 0 255;

    Then the diffuse component of the material of the first child will be red, the diffuse component of the material of the second child will be green and, the diffuse component of the material of the third child will be blue.

  • If the data received is

    MAT=COLOR 255 0 0;

    then all the container’s material will be set to red.

  • If the data received is

    MATERIAL MATERIAL*blue;

    Then the material will set to the blue material in Viz material library.

Note: DataMaterial plugin will not work unless the controlled containers have a material on them. If controlling child containers from a top node, each of the controlled child containers must have a material attached to it. The top container, hosting the DataMaterial plugin, doesn’t need to have a material attached to it.