<<VRML 2.0 - An Introductory view by examples

ColorInterpolator

[interpolator's example]                                       [run]


ColorInterpolators interpolate linearly among a set of MFColor values (keyValue parameter). A linear interpolation using the value set_fraction as input is performed in HSV space. Results are RGB values. The vectors are interpreted as absolute positions in object space.

{
eventIn SFFloat set_fraction # this input float value causes the interpolator function to evaluate
exposedField MFFloat key [ ] # key values in the set_fraction domain
exposedField MFColor keyValue [ ] # functions values (1:1 related to above field)
eventOut SFColor value_changed # current output value (associated to the current time)
}

Usage :


    ColorInterpolator {
          key [0, 0.5, 1]
          keyValue [1 0 0, 0 1 0, 0 0 1]
                          }