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} 10The first line loads some geometry into
Geomviewfor display. In this case, we load one of the data files that came withGeomviewthat is inGeomview'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 namedpi, 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 inGeomviewhas 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
Sequencecommand 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
Executebutton. This will start up the back-end process (calledBackStage), and show the execution window that informs you of the progress of the movie. Anything that is in theGeomviewcamera 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
|
|
|