Table of Contents Chapter Index Previous Slide Next Slide 434
A sample Java script

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

  • Give it the same interface as the JavaScript example
    DEF Bouncer Script {
        field    SFFloat bounceHeight 3.0
        eventIn  SFFloat set_fraction
        eventOut SFVec3f value_changed
        url "bounce2.class"
    }