ParallelGraphics
Home  »  Developer Zone  »  Products  »  Cortona3D Viewer  »  VRML Extensions  »  Interpolator Nodes in Cortona
Up to VRML Extensions

ColorInterpolatorEx Node 

OrientationInterpolatorEx Node 

PositionInterpolator2DEx Node 

PositionInterpolatorEx Node 

ScalarInterpolatorEx Node 


Subscribe to Newsletter
 


Google Searchsite search:

 

%(domain)s %(domain)s
Install Cortona3D Viewer

Outline3D


Interpolator Nodes in Cortona
The standard VRML interpolator nodes, such as, ColorInterpolator, CoordinateInterpolator, NormalInterpolator, OrientationInterpolator, PositionInterpolator, ScalarInterpolator nodes, and ParallelGraphics Position2Interpolator node are designed for linear keyframed animation among the lists of SFColor, SFVec3f, SFRotation, SFFloat and SFVec2f values. These nodes are used as a base for most simple animations in VRML scenes. The implementation of smooth (non-linear) animations in VRML is possible only with the use of the Script VRML node. Apart from being inconvenient for content creators, this results in significant reduction in performance. If smooth animations are created with the use of linear interpolators, a larger number of keyframes and therefore substantially larger size of files result.

Five new ParallelGraphics VRML extension nodes:

 

ColorInterpolatorEx,

 
OrientationInterpolatorEx,
 
PositionInterpolator2DEx,
 
PositionInterpolatorEx,
 
ScalarInterpolatorEx

were introduced to resolve this problem by extending the capabilities of existing interpolator nodes of the corresponding types. By setting the value of the type field of the new interpolator nodes, the content creator can choose the desired type of interpolation - how the values of a parameter should be generated between keyframe values. Specifying non-linear interpolation types allows developers to create smooth and realistic animations with the use of a minimum number of keyframes.

All the new ParallelGraphics interpolator nodes, except for the OrientationInterpolatorEx node, share the following common set of fields and semantics:

eventInSFFloatset_fraction 
exposedField  MFFloatkey[...]
exposedFieldMF<type>keyValue[...]
eventOutSF<type>value_changed   
exposedFieldSFString  type"LINEAR"
exposedFieldMFFloatparams[0, 0, 0] # (-inf,inf)

The type field specifies the type of interpolation used. The following values of this field are possible: "CONSTANT", "LINEAR", "COSINE", "CUBIC" and "HERMITE":

Value of the type field   Interpolation
"CONSTANT"The value remains fixed until the next keyframe. No interpolation is performed.
"LINEAR"The value changes linearly from the previous to the next keyframe value. For complex values, each of the components changes independently of other components. The speed of the value change (acceleration or deceleration) is constant throughout the interval. This is how interpolation is performed by standard VRML interpolator nodes which the corresponding ParallelGraphics interpolator nodes extend.
"COSINE"The value changes according to the cosine law in the interval between the previous and the next keyframe values. The speed of the value change is minimum (zero) both at the beginning and end of the interval while the maximum speed of the value change is achieved in the middle of the interval.
"CUBIC"The value changes between keyframes values according to cubic law. Cubic splines provide quick and smooth interpolation of values.
"HERMITE"The Kochanek-Bartels splines (also known as TCB splines), which are based on Hermite polynoms, provide cubic interpolation of the parameter between keyframes values. The exact type of dependence between the values of a key and the corresponding keyValue parameter (interpolation function) can be customized using three TCB-splines parameters specified by the params field.

Notes (for "CUBIC" and "HERMITE" interpolation types):
 
Linear interpolation is used instead of cubic interpolation if the number of keyframes is less than 4.

 
If the value of the first keyframe coincides with the value of the last keyframe, the cubic spline is "closed", i.e. there is no derivative hit of keyValue when interpolating between the last and first keyframes.

Three values in the params field of the interpolator nodes with extended capabilities specify the parameters of Kochanek-Bartels splines which customize the interpolation function:

Parameter  NameDescription
0TensionSpecifies the bending sharpness of the interpolation function at keyframes (higher tension values correspond to tighter function curves, lower - to looser curves).
1Continuity  Specifies the variation in derivative of the interpolation function from the left and right at keyframes (zero - transition between adjacent intervals at keyframes is smooth, non-zero - intersections of intervals are abrupt).
2Bias Controls the amount that the interpolation function bends at each end of the interval between keyframes (Bias<0 - the function bends more at the beginning of the interval, Bias>0 - the function bends more at the end).

Note: if the values of the Continuity and Bias parameters are equal to 0, the Kochanek-Bartels splines are identical to cardinal splines. If all three parameters are equal to zero (the default value of the params field), the TSB splines are identical to the Catmull-Rom splines.

The OrientationInterpolatorEx node has only one additional field - type. This field can take on the following values: "CONSTANT", "LINEAR" (slerp) and "SPLINE" (squad) that specify constant, linear and cubic spline interpolation respectively.

Definitions of the other fields and events in the interpolator nodes are similar to the definitions of the corresponding standard VRML nodes. More information about interpolators in VRML is available at the Interpolators nodes topic in the VRML97 Specification.

ScalarInterpolatorEx node example
[view]




Last updated: Fri, 10 Feb 2012
© 2000-2011 ParallelGraphics. All rights reserved. Terms of use.