Scenes would be pretty boring if the surface every object had
the same basic appearance. The easiest way to change the appearance
of objects is with a Material
node.
Most of the fields for this class are devoted to controlling colour
in various ways. Colour is specified as triple like "0.0 0.4 0.8"
that reflects the amount of red, green, and blue (respectively) to mix
to product the colour. A value of 0.0 means don't use any of that
primary colour, while a value of 1.0 means that you want 100%
saturation of that primary colour. Creating colours is almost an
art form in itself. The simplest approach for beginners is to
start with the ambientColor
field to specify
the colour of an object, but once you are used to this go on to
experiment with the other fields to see how they modify the results.
Sometimes the difference is only apparent with different lighting
situations.
The fields and respective default values are:
Material { ambientColor 0.2 0.2 0.2 diffuseColor 0.8 0.8 0.8 specularColor 0 0 0 emissiveColor 0 0 0 shininess 0.2 transparency 0 }
Here is a Material
node that would colour objects a
pure blue:
Material { ambientColor 0.0 0.0 1.0 }
This example would result in a transparent, relatively shiny greenish colour, possibly for use with colouring an object made out of glass:
Material { ambientColor 0.0 0.4 0.1 shininess 0.5 transparency 0.7 }
Some information about materials in Open Inventor is available in chapter 3 of Inventor Mentor. More complex ways of changing appearance with textures are discussed in chapter 7.