StageTools - Documentation (StageManager/Tutorial)

We will make a simple animation suitable for use as a moving logo on a web page. Our animation will show a cube rotating in space. To define the movie, type in the following script into `StageManager`'s main window:

```    Load cube
Color cube {0 0 1}

Transform {YZ -\$pi/3}
Transform {XY -\$pi/6}

Sequence {XY \$pi/2} 10
```

The first line loads some geometry into `Geomview` for display. In this case, we load one of the data files that came with `Geomview` that is in `Geomview`'s default input path. As the name implies, it is a cube. The second line colors the cube solid blue (the original cube has ugly colored sides). The next two commands set the initial viewpoint for the cube (actually, they rotate the coordinate system of the entire world, but this amounts to nearly the same thing). Note the presence of the dollar signs in front of "`pi`". This is due to the syntax of the underlying TCL/TK programming language; the value of p is actually stored in a variable named `pi`, and the dollar sign asks that its value be substituted into the equation before the value of the expression is computed.1 The first transformation is in the yz-plane and the second is in the xy-plane. The initial viewpoint in `Geomview` has the positive z-axis pointing out of the screen (with the x and y axes in their usual positions for drawing a graph on screen), so this rotates the cube so that we are looking toward one of its corners.

At this point no frames have been produced for the movie; these transformation are simply to set the initial position. The `Sequence` command is the one that causes actual frames for the movie to be generated. In this case, it cases a rotation by 90 degrees in the xy-plane (i.e., around the z axis) in 10 steps. We will require that our movie loop forever, and so the symmetry of the cube will make it appear that it is performing a full 360 degree rotation. Many other types of transformations are possible.

To preview the movie in Geomview, press the `Execute` button. This will start up the back-end process (called `BackStage`), and show the execution window that informs you of the progress of the movie. Anything that is in the `Geomview` camera window will be deleted, and you should (eventually) see the blue cube show up and rotate. It will probably rotate pretty fast, so don't be surprized; you can always execute the movie again.

 1 You may have noted that you do not need to use such dollar signs in `CenterStage` equations. This is because the `CenterStage` program includes a special mathematics parser written to make the syntax of equations more natural for mathematicians. This parser is called by the `let` command and other commands defined by `CenterStage`. The `StageManager` module predates `CenterStage`, however, and has not been retro-fitted to include the new parser. This is one of the things on the list of updates to be made, but most of the recent programming efforts have gone into improving `CenterStage`.

 StageTools Documentation web pages Created: 08 Sep 2001 Last modified: 07 Jan 2001 06:26:15 Comments to: `dpvc@union.edu`