## X3D Example Archives: Conformance Nist, Interpolators, Coordinate Interpolator

 CoordinateInterpolator linearly interpolates among a list of 3-tuple MFVec3f arrays, producing a single MFVec3f array that is fractional average between two nearest arrays in the list. Authors can ROUTE value_changed output events (an array of 3-tuple SFVec3f values) to a Coordinate node's point field, or to another MFVec3f field. X3D Tooltips of interest: CoordinateInterpolator. X3D Specification sections of interest: 19 Interpolation component, 19.2 Concepts and 19.4.2 CoordinateInterpolator. X3D Examples Archives of related interest: VRML 2 Sourcebook:  Chapter 13 Points Lines Faces, Figure 13 17a Morphing Cube and Figure 13 17b Morphing Cube Line Set X3D for Web Authors: Chapter 07 Event Animation Interpolation
5 X3D Scenes       Scene Descriptions
hierarchy Test of a CoordinateInterpolator node to continue to generate and receive events when outside the Transform hierarchy. A Switch node is the parent of a CoordinateInterpolator node that changes the shape of an IndexedFaceSet geometry. The CoordinateInterpolator has been "switched out" by setting the whichChoice field to -1. The result should be, the CoordinateInterpolator should continue send and receive events, and animate the shape of the geometry. The geometry should stretch along the X, Y and Z axex.
keys 1000 Test minimum conformance requirement of 1000 key/keyValue pairs for a CoordinateInterpolator node. 1000 sets (each set consisting of the 8 vertices of a cube) of coordinate keys are matched to a linear set of keyframes from 0 to 1. Each coordinate set expands the cube from a volume of 0 to a size of 2 2 2, then back to 0, in a 5 second interval.
samekeys Test keys with same value. A CoordinateInterpolator node is used to change the coordinate location at each vertex on a rectangular shaped IndexedFaceSet. The fraction_changed field of a TimeSensor node is used to control the keyframe animation of the normals. The keys for the CoordinateInterpolator are set to values [ 0, 0.25, 0.5, 0.5, 0.5, 0.75, 1.0 ], and the keyValues for the 8 vertices are set to [ -1 1 1, -1 -1 1, 1 1 1, 1 -1 1, 1 1 -1, 1 -1 -1, -1 1 -1, -1 -1 -1 -2 1 1, -2 -1 1, 2 1 1, 2 -1 1, 2 1 -1, 2 -1 -1, -2 1 -1, -2 -1 -1 -1 1 1, -1 -1 1, 1 1 1, 1 -1 1, 1 1 -1, 1 -1 -1, -1 1 -1, -1 -1 -1 -1 1 2, -1 -1 2, 1 1 2, 1 -1 2, 1 1 -2, 1 -1 -2, -1 1 -2, -1 -1 -2 -1 1 1, -1 -1 1, 1 1 1, 1 -1 1, 1 1 -1, 1 -1 -1, -1 1 -1, -1 -1 -1 -1 2 1, -1 -2 1, 1 2 1, 1 -2 1, 1 2 -1, 1 -2 -1, -1 2 -1, -1 -2 -1 -1 1 1, -1 -1 1, 1 1 1, 1 -1 1, 1 1 -1, 1 -1 -1, -1 1 -1, -1 -1 -1 ] Because the three middel keys have the same value, the first and last identical key should serve as a limit for that key, and should result in the geometry expanding along the X axis, return to its original shape, then expand along the Y axis, then return to its original shape, in a 5 second time interval. The geometry should NOT expand along the Z axis.
simple Test of basic functionality. A CoordinateInterpolator node is used to continuously change the coordinate location at each vertex on a rectangular shaped IndexedFaceSet. The fraction_changed field of a TimeSensor node is used to control the keyframe animation of the normals. The keys for the NormalInterpolator are set to values [ 0, 0.17, 0.34, 0.51, 0.68, 0.86, 1.0 ], and the keyValues for the 8 vertices are set to [ -1 1 1, -1 -1 1, 1 1 1, 1 -1 1, 1 1 -1, 1 -1 -1, -1 1 -1, -1 -1 -1 -2 1 1, -2 -1 1, 2 1 1, 2 -1 1, 2 1 -1, 2 -1 -1, -2 1 -1, -2 -1 -1 -1 1 1, -1 -1 1, 1 1 1, 1 -1 1, 1 1 -1, 1 -1 -1, -1 1 -1, -1 -1 -1 -1 1 2, -1 -1 2, 1 1 2, 1 -1 2, 1 1 -2, 1 -1 -2, -1 1 -2, -1 - 1 -2 -1 1 1, -1 -1 1, 1 1 1, 1 -1 1, 1 1 -1, 1 -1 -1, -1 1 -1, -1 -1 -1 -1 2 1, -1 -2 1, 1 2 1, 1 -2 1, 1 2 -1, 1 -2 -1, -1 2 -1, -1 -2 -1 -1 1 1, -1 -1 1, 1 1 1, 1 -1 1, 1 1 -1, 1 -1 -1, -1 1 -1, -1 -1 -1 ] This should result in a continuous change in the coordinate location of each vertex, such that the geometry appears to stretch along the X axis, return to its original size, stretch along the Z axis, return to its original size, then stretch vertically, then again return to its original size, all in a 5 second cycle.
value changed Test of a CoordinateInterpolators ability to load the correct keyValue into its "value_changed" field prior to receiving any events. Two CoordinateInterpolator node are associated with two seperate IndexedFaceSet geometry. The CoordinateInterpolator associated with the IndexedFaceSet on the left has keyValues that create a box shape that is twice its initial size, while the CoordinateInterpolator associated with the right Box has the default of no keyValues, or [ ]. As a result, the CoordinateInterpolator on the left should initialize its "value_changed" field to the value of its first keyValue when the pointing device indicates the box, and the box should appear to double in size while it is indicated by the pointing device. Because no keyValues are provided to the right CoordinateInterpolator, it should initialize its "value_changed" field to the MFVec3f default value of an empty MFVec3f field. Passing the pointing device over the right box should not result in any change in the size of the box. Michael Kass
 Master source-code model archive is under subversion control at https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/ConformanceNist/Interpolators/CoordinateInterpolator

The X3D Resources: Examples page and Savage Developers Guide provide more information about the production of this archive.