Animated Switch of Elevation Grids
Exercise


Description


VRML Concepts

Files

Tasks

  1. Create and edit a new VRML file named "animgrd1.wrl". In "animgrd1.wrl", add the following:

    When you load your world, the timer will repeatedly poke the program script, which will generate integer choice values for the switch. This will cause the switch to animate and cycle between your box and sphere shapes.

    SOLUTION: animgrd1.wrl


  2. Copy your "animgrd1.wrl" file to "animgrd2.wrl" and edit it. In "animgrd2.wrl", delete your box and sphere shapes and replace them with ten Inline nodes to inline ten different elevation grids, like this:

    Change the Script node's numberOfChoices field value to 10 instead of 2.

    Load the world into your VRML browser and watch as your program script animates the Switch node to cause it to cycle between the ten elevation grids. The first pass or two may stutter along as your browser reads in the grids.

    SOLUTION: animgrd2.wrl