next up previous contents index
Next: 4. Tips Up: 3. Concepts Previous: 3.2 Describing a whole   Contents   Index

3.3 Constructs used in input files

Each number or string in an input file causes that a number or string node is created.

Nodes, seperated by commas, in a pair of round braces cause that a new node is created, which is connected with an edge to each of these nodes.

If there is a typename before a pair of braces, a node of that type is created, else a typeless, generic node (list) is created. For example POLYLINE( v ); would create a polyline node which is connected to the node v with an edge.

Please see chapter 6 for more information about the different node types, and which connections to other nodes they accept.

I tried to follow the convention that typed nodes are always connected to a fixed number of nodes. For example the POLYLINE node from above is connected to a list of vertices, instead of to the vertices themself (a variable number). But there are some exceptions from this rule, the transformation group and attribute group nodes (see Chapter 6) are directly connected to their transformations respectively attributes.

It is possible to select a child node of a certain node via angular brackets.

p = (x, y, z);

lastchild = [p];     /* delivers z */
child1    = [1, p];  /* delivers x */
child2    = [2, p];  /* delivers y */
child3    = [3, p];  /* delivers z again, and so on */

There are also function nodes.

A function node is connected to a list of parameters. When the function node is validated it creates the result node, and connects itself with an edge to this result node, So the result node is the second child node of the function node (the first one is the parameter list).

When the function is reevaluated (for example when one of its parameters change), the edges from the result node to its child nodes are cutted, and the result node is connected to new child nodes. This means that the result node never changes its address (and type) during the program run.

In the following example a function node is created which reads an Alias Wavefront OBJ file. Afterwards its result node (is of type scene graph node) gets referenced as the child node of another scene graph node.

object1 = READ_FILEFORMAT_OBJ( ("galleon.obj") );
SCENEROOT = SCENENODE( ([object1]), (), () );


next up previous contents index
Next: 4. Tips Up: 3. Concepts Previous: 3.2 Describing a whole   Contents   Index
Administrator 2002-01-20