]>
We begin our discussion of interactive graphics with the creation of a useful facility: plotting ribbons of two-graphs in three-space. Suppose you want to draw the two-dimensional graphs of functions all over some fixed range of . One approach is to create a two-dimensional graph for each one, then superpose one on top of the other. What you will more than likely get is a jumbled mess. Even if you make each function a different color, the result is likely to be confusing.
A better approach is to display each of the in three ribbon dimensions as a ``ribbon'' of some appropriate width along the -direction, laying down each ribbon next to the previous one. A ribbon is simply a function of and depending only on .
We illustrate this for defined as simple powers of for ranging between and .
Draw the ribbon for .
Now that was easy! What you get is a ``wire-mesh'' rendition of the ribbon. That's fine for now. Notice that the mesh-size is small in both the and the directions. Axiom normally computes points in both these directions. This is unnecessary. One step is all we need in the -direction. To have Axiom economize on -points, we re-draw the ribbon with option .
Re-draw the ribbon, but with option so that only step is computed in the direction.
The operation has created a viewport, that is, a graphics window on your screen. We assigned the viewport to and now we manipulate its contents.
Graphs are objects, like numbers and algebraic expressions. You may want to do some experimenting with graphs. For example, say
to put a bounding box around the ribbon. Try it! Issue to rotate the figure longitudinal degrees and latitudinal degrees.
Here is a different rotation. This turns the graph so you can view it along the -axis.
There are many other things you can do. In fact, most everything you can do interactively using the three-dimensional control panel (such as translating, zooming, resizing, coloring, perspective and lighting selections) can also be done directly by operations (see Chapter ugGraph for more details).
When you are done experimenting, say to restore the picture to its original position and settings.
Let's add another ribbon to our picture---one for . Since ranges from to for the first ribbon, now let range from to . This puts the second ribbon next to the first one.
How do you add a second ribbon to the viewport? One method is to extract the ``space'' component from the viewport using the operation subspacesubspaceThreeDimensionalViewport. You can think of the space component as the object inside the window (here, the ribbon). Let's call it . To add the second ribbon, you draw the second ribbon using the option .
Extract the space component of .
Add the ribbon for alongside that for .
Unless you moved the original viewport, the new viewport covers the old one. You might want to check that the old object is still there by moving the top window.
Let's show quadrilateral polygon outlines on the ribbons and then enclose the ribbons in a box.
Show quadrilateral polygon outlines.
Enclose the ribbons in a box.
This process has become tedious! If we had to add two or three more ribbons, we would have to repeat the above steps several more times. It is time to write an interpreter program to help us take care of the details.