Interpolators : animation

Gavin Bell, gavin@sgi.com
Daniel Woods
Silicon Graphics

This document is available at http://reality.sgi.com/employees/gavin/vrml/Interpolators.html and was last updated Dec. 11, 1995.

Interpolators are nodes that are useful for doing keyframed animation. Given a sufficiently powerful scripting language, all of these interpolators could be implemented using Logic nodes (browsers might choose to implement these as pre-defined prototypes of appropriately defined Logic nodes). We believe that keyframed animation will be common enough to justify the inclusion of these classes as built-in types.

Interpolator node names are defined based on the concept of what is to be interpolated: an index, orientation, coordinates, position, color, normals, etc. The fields for each interpolator provide the details on what the interpolators are affecting.

Issue: do we want to do automatic SF/MF type conversion? Or define different interpolators? For example, the CoordinateInterpolator is merely an SF to MF change to the outValue of the PositionInterpolator.

ColorInterpolator

This node interpolates among a set of MFColor values, to produce MFColor outValue events. The number of colors in the values field must be an integer multiple of the number of keyframe times in the keys field; that integer multiple defines how many colors will be contained in the outValue events. For example, if 7 keyframe times and 21 colors are given, each keyframe consists of 3 colors; the first keyframe will be colors 0,1,2, the second colors 3,4,5, etc. The color values are linearly interpolated in each coordinate.

The description of MF values in and out belongs in the general interpolator section above, or maybe we should split up the interpolators into single-valued and multi-valued sections.

FILE FORMAT/DEFAULTS
     ColorInterpolator {
          keys            [ ] # MFFloat
          values          [ ] # MFColor
          # eventIn  SFFloat    setAlpha
          # eventOut MFColor    outValue
     }

OrientationInterpolator

This node interpolates among a set of SFRotation values. The rotations are absolute in object space and are, therefore, not cumulative. The values field must contain exactly as many rotations as there are keyframe times in the keys field, or an error will be generated and results will be undefined.

FILE FORMAT/DEFAULTS
     OrientationInterpolator {
          keys            [ ]       # MFFloat
          values          [ ]       # MFRotation
          # eventIn  SFFloat    setAlpha
          # eventOut SFRotation outValue
     }

PositionInterpolator

This node linearly interpolates among a set of SFVec3f values. This would be appropriate for interpolating a translation.

FILE FORMAT/DEFAULTS
     PositionInterpolator {
          keys            [ ] # MFFloat
          values          [ ] # MFVec3f
          # eventIn  SFFloat    setAlpha
          # eventOut SFVec3f    outValue
     }

CoordinateInterpolator

This node linearly interpolates among a set of multiple-valued Vec3f values. This would be appropriate for interpolating vertex positions for a geometric morph.

The number of coordinates in the values field must be an integer multiple of the number of keyframe times in the keys field; that integer multiple defines how many coordinates will be contained in the outValue events.

FILE FORMAT/DEFAULTS
     CoordinateInterpolator {
          keys            [ ] # MFFloat
          values          [ ] # MFVec3f
          # eventIn  SFFloat    setAlpha
          # eventOut MFVec3f    outValue
     }

NormalInterpolator

This node interpolates among a set of multi-valued Vec3f values, suitable for transforming normal vectors. All output vectors will have been normalized by the interpolator.

The number of normals in the values field must be an integer multiple of the number of keyframe times in the keys field; that integer multiple defines how many normals will be contained in the outValue events.

FILE FORMAT/DEFAULTS
     NormalInterpolator {
          keys            [ ] # MFFloat
          values          [ ] # MFVec3f
          # eventIn  SFFloat    setAlpha
          # eventOut MFVec3f    outValue
     }

ScalarInterpolator

This node linearly interpolates among a set of SFFloat values. This interpolator is appropriate for any parameter defined using a single floating point value, e.g., width, radius, intensity, etc. The values field must contain exactly as many numbers as there are keyframe times in the keys field, or an error will be generated and results will be undefined.

FILE FORMAT/DEFAULTS
     ScalarInterpolator {
          keys            [ ] # MFFloat
          values          [ ] # MFFloat
          # eventIn  SFFloat    setAlpha
          # eventOut SFFloat    outValue
     }

IndexInterpolator

This node interpolates among a set of SFLong values and can be used to switch the active child of a switch node. The values field must contain exactly as many entries as there are keyframe times in the keys field, or an error will be generated and results will be undefined. The interpolation output is defined to be the value at the start of the interval in which the Alpha value is found.

FILE FORMAT/DEFAULTS
     IndexInterpolator {
          keys            [ ] # MFFloat
          values          [ ] # MFLong
          # eventIn  SFFloat    setAlpha
          # eventOut SFLong     outValue
     }

BoolInterpolator

This node interpolates among a set of SFBool values and can be used to turn on/off aspects of the world, e.g., lights. The values field must contain exactly as many entries as there are keyframe times in the keys field, or an error will be generated and results will be undefined. The interpolation output is defined to be the value at the start of the interval in which the Alpha value is found.

FILE FORMAT/DEFAULTS
     BoolInterpolator {
          keys            [ ] # MFFloat
          values          [ ] # MFBool
          # eventIn  SFFloat    setAlpha
          # eventOut SFBool     outValue
     }