Table of Contents Previous Chapter Details Viewpoint Slideshow Next Chapter Details X3D Resources

X3D Example Archives: Conformance Nist, Interpolators, Scalar Interpolator

X3D Scenes Descriptions
1000keys Test minimum conformance requirement of 1000 keys/keyValues for a ScalarInterpolator. A ScalarInterpolator linearly interpolates between 1000 intensity values ranginge from 0 to 1 along a sine curve. The result is a varying intensity of a PointLight that ranges from dark, to maximum intensity, then back to dark in a 10 second interval.
hierarchy Test of a ScalarInterpolator node to continue to generate and receive events when outside the Transform hierarchy. A Switch node is the parent of a ScalarInterpolator node that changes the illumination of a Cylinder geometry by a PointLight. The ScalarInterpolator has been "switched out" by setting the whichChoice field to -1. The result should be, the ScalarInterpolator should continue send and receive events, and animate the illumination of the Cylinder geometry.
samekeys Test keys with same value. A ScalarInterpolator node is used to change the intensity of a SpotLight that illuminates a Cylinder geometry. The fraction_changed field of a TimeSensor node is used to change the position from keyValues of [ 0.0, 0.5, 1.0, 0.5, 0.0 ] for keys of [ 0.0, 0.5, 0.5, 0.5, 1.0 ] respectively. As a result: because of the three identical keys (0.5), the leftmost and rightmost identical keys serve as limits for that key, and result in a 1/4 intensity of light upon the Cylinder for the time interval between the two limits. The Cylinder should NOT reach full illumination intensity, but should begin with no illumination, increase to 1/4 maximum illumination, then decrease again to no illumination over a 5 second period.
simple Test of basic functionality. A ScalarInterpolator node is used to change the intensity of a SpotLight that illuminates a Cylinder geometry. The fraction_changed field of a TimeSensor node is used to change the position from keyValues of [ 0.0, 0.5, 1.0, 0.5 0.0 ] for keys of [ 0, 0.25, 0.5, 0.75 and 1.0 ] respectively. As a result: the Cylinder geometry will increase from no illumination to maximum illumination, then decrease to no illumination over a 5 second time interval.
value changed Test of a ScalarInterpolators ability to set its initial "value_changed" field to the correct value prior to receiving any events. Two ScalarInterpolator node are associated with two seperate Cylinder geometry. The ScalarInterpolator associated with the Cylinder on the left has a keyValue of 1.0, while the ScalarInterpolator associated with the right Cylinder has the default of no keyValues, or [ ]. As a result, the ScalarInterpolator on the left should initialize its "value_changed" field to the value of its first keyValue, or 1.0 . Because no keyValues are provided to the right ScalarInterpolator, it should initialize its "value_changed" field to the SFFloat default value of 0.0 A Script node reads this value for each ScalarInterpolator, and will illuminate the associated Cylinder in intensity by a value equal to its initially read "value_changed" SFFloat value. When the pointing device passes over the left Cylinder, it should illumminate to an intensity value of 1.0 (bright) each time it is indicated, then return to its original intensity (0.5) when no longer indicated by the pointing device. When the pointing device passes over the right Cylinder, it have no light intensity (ie. it should remain black).

Online at http://www.web3d.org/x3d/content/examples/ConformanceNist/Interpolators/ScalarInterpolator

Master source code archive is under subversion control at
http://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/ConformanceNist/Interpolators/ScalarInterpolator

Table of Contents Previous Chapter Details Viewpoint Slideshow Next Chapter Details X3D Resources

Also available: current and archived nightly builds and distributions of these examples, all published under an Open-Source License.

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