Westermania Documentation


Introduction

The Aura Scenegraph allows a 3D-Scene to be modelled in a tree structure, allowing efficient organisation, transformations, culling, collision-detection, etc.

Scenegraph structure

An Aura Scenegraph is a tree (a directed acyclic graph), in witch all nodes are objects of the class caGraph or a subclass of caGraph.

The tree's root element is a caScene object, the inner nodes are caGraph objects. All geometry, lighting, etc. information is stored in the leaf-nodes, which can be objects of the following classes: caGeometry, caLight, or caCamera.

Example of the Scenegraph structure


The scene's geometry (Points, Triangles, Polygons, etc.) and it's respective state (color, texture, fill-mode, etc.) are stored in the caGeometry nodes, light sources (directional, ambient, etc.) are stored in caLight nodes, and cameras (mobile viewports) are stored in caCamera nodes.

Geometry organization

To make use of the advantages of the scenegraph, the scene's geometry should be organised efficiently.

In general, smaller objects that are attached to (or belong to) a larger object (e.i. fingers and a hand) should be in a child-graph of the graph the large object is stored in. This not only allows for efficient culling etc. (if the hand isn't in sight, the fingers needn't be checked) it also enables efficient and natural movement. Any transformation applied to the hand will also be applied to the fingers, however moving the fingers won't move the hand!

Transformations (scaling, rotation, etc.) are stored in any caGraph object. They are applied to all child-nodes, or to the object itself, if it is a leaf node.

Example of graph organisation


Describing Geometry

All of the scene's actuall geometry, triangles, polygons, etc., are stored in buffers, (objects of the class caVertexBuffer).

Vertex buffers store a list of vertices (x,y,z coordinates), and a variable specifying the type of geometry that the vertices represent (lines, triangles, quads, etc.).

Vertex buffers only store pure geometry. Information on how the geometry should be rendered (color, texture, etc.) are stored in state buffers (caState). State buffers hold information for everything from filling modes over color and textures to lighting of geometry.

Every caGeometry-node owns (is assigned a) vertex buffer, and a state buffer. Only one vertex and state buffer can be active in a geometry-node at any given time, however vertex and state buffers can be assigned to (owned by) several geometry-nodes at once. In other words indentical geometry doesn't have to be stored several times and geometry with the same states don't have to be described seperately.

Example of a complete scene graph



Aura Class-Hierachy:

 


Vertex Buffers

Description coming soon. See comments in Sourcecode for first Information.


State Buffers

Description coming soon. See comments in Sourcecode for first Information.


Geometry-Nodes

The caGeometry class, is a leaf-node of the scene Graph. It contains geometry (using a vertex buffer), the geometry's state (using a state buffer), and transformations to be performed on the contained geometry.

The constructor takes no arguments.

Methods:

 

 

.......................


 

 


Light-Nodes

The caLight class, is a leaf-node of the scene Graph. It contains informtion about the ambien-, diffuse-, specularcolor (and the position ???).

The constructor takes no arguments.

Methods:



Camera-Node

The caCamera class, is a leaf-node of the scene Graph.It holds information about the field of view, H/O aspect ratio, deph-range and the projectionmatrix.

The constructor takes no arguments.

Methods:


The Scene-Node

Methods:


caGraph Class