Table of contents Chapter index Previous slide Next slide 413
A sample JavaScript script

Writing program scripts with JavaScript
A sample JavaScript script
  • Create a Bouncing ball interpolator that computes a gravity-like vertical bouncing motion from a fractional time input

  • Nodes needed:
    DEF Ball Transform {
        children [ . . . ]
    }
    DEF Clock TimeSensor {
        . . .
    }
    DEF Bouncer Script {
        . . .
    }