Next Previous Contents

Making a component tree

At the bottom of the subtrees for your new objects entry in the object tree is the structure tree. This contains the components used by the GLASS object, and the shape of the tree will affect the way things are displayed.

Add the first component with Object->Add Component. This adds a new component entry. Edit it by double clicking on it. This gives the components dialog:

We want this component to translate the cone to a point (x,y,z) before drawing it, so select the triangle list from "No List" to "cone" in the first combo box, and change the transform type from "No Transform" to "Translate". When the transform type is changed, spin buttons appear below which contain the values required by this transform. The "V" buttons beside the spin buttons allow a value to be controlled by a variable, this will be described in detail later. For example the "Translate" transform takes 3 values, the x, y, and z (in this order) co-ordinates of the transform. I set them to (2.0, -2.0, 1.0). Select apply when finished.

The views now display the cone, but it is no longer centered about the origin (0, 0, 0). This is because the translation has come into effect before the cone has been drawn. On the 3D view:

The next step is to add a component that inherits this transform. For example, to put an upside down cone at the same point as the first cone, we would make a new component that is the child of this component by using Component->Add Child while selecting the first component. To rotate the cone, use the transform "Rotate X" with a value of 180.0.

If this component was the sibling of the first component, then the upside-down component would be centered at the origin. Using lots of these components you can quickly come up with a complex object.

Note that the scaled cone is overly shiny, this is because when something is scaled it scales the vertex normals too, which affects the lighting -- making scales not very useful transforms.

The problem with all these transforms, is that they're all using constants. If you were going to use this GLASS object in a program, chances are you'd want to modify some of these transforms. This is what variables do.

Next Previous Contents
Robert Cleaver Ancell
Last modified: Thu Aug 16 23:13:24 NZST 2001