StageTools - Documentation (CenterStage/Tutorial) [Prev][Top][Up][Next]


Creating Your First Surface

To make a new object, select the New item in the Objects menu. You should get a dialog box that lists various types of objects, with Surface the selected type. The Object name field is the title for the object; it will be Surface by default, which is fine. Hit the OK button. The name of the object (Surface) will appear in the object list at the right of CenerStage's main window, and the default surface definition will appear in the definition area. If you hit the Update button, CenerStage will compute the object and display it in Geomview's camera window. You have made your first object! To rotate it, press and drag the mouse button in Geomview's camera window.

The information in the definition script tells CenerStage what the object looks like. Surface objects are parameterized surfaces, and you can see the definition of the function and its domain given here. The Function command first gives the two variables for the parametric surface (in this case, u and v). The rest of the function is a TCL script that computes the values of the variables x, y and z for a given set of values for the input parameters. These three values specify the position of the surface in space. In the example, we see that x = u, y = v and z = u v. The latter means that z is u times v; note that the space between u and v is required, otherwise CenerStage will think that this is the variable whose name is uv, and will report an error since that variable doesn't exist. This means that the surface is really the graph of the function f(u,v) = uv. It would also have been possible to specify this as

    Function {u v} {
      let x = u
      let y = v
      let z = u v
    }
or even better, as
     Function {x y} {
       let z = x y
     }
(Note that capitalization counts, so you must use Function not function, and the variable X is different from x).

The Domain command tells CenerStage what values of u and v to use when constructing the surface. In this case, u is to run from -1 to 1 and there will be 10 divisions along this direction, and similarly for v. This means that the domain for the surface is a 10ยด10 grid of squares forming a large square with corners at (-1,-1), (1,-1), (1,1) and (-1,1). By default, CenerStage will represent that domain as a solid patch, but you can change that to be any of a number of different styles using the Domain menu. For example, selecting the Domain/Grid menu would make the surface appear as a collection of lines rather than a solid surface.

In a similar way, you can change other surface attributes. For instance, setting Shading to Smooth in the Appearance menu tells CenerStage to use an interpolation method to color the faces so that the surface looks smoother. (You need to set Domain back to Patch to see this.) The transparency effect listed in this menu is not available in all implementations of Geomview, in particular, the X11 version.

You can control the coloring method via the Color menu. By default, the points on the object are colored by their height in the z direction, but you can change that to a number of other coloring schemes. Experimenting with these is left as an exercise for the reader.



[HOME] StageTools Documentation web pages
Created: 08 Sep 2001
Last modified: 08 Sep 2001 15:58:33
Comments to: dpvc@union.edu
[Next] Adding Sliders
[Up] A Short CenterStage Tutorial
[Prev] Starting up CenterStage