
The Virtual Universe object is the root of our scenegraph. The Locale object is the container for the subgraphs.
Our scenegraph has two subgraphs.The content branchgraph contains our Rubik’s Cube and in the view branchgraph the objects for rendering the Rubik’s Cube are stored.
We built up our scenegraph with the Simple Universe object. This object
creates a Virtual Universe, a Locale and a view branchgraph with default
values. (That’s sufficient for our Rubik’s Cube.)So we have “only” to look
after the implementation of the content branchgraph.

The content branchgraph has two subgraphs:
In the Rubik’s
Cube branchgraph the Rubik’s Cube is stored.
In the light
branchgraph the ambient of the cube like background and
lights is generated.
The Rubik’s Cube branchgraph is one of the subgraphs of the content
branchgraph.
In the Rubik’s Cube branchgraph the Rubik’s Cube is generated as following:
The Rubik’s Cube Transformgroup (TG) is the root of the Rubik’s Cube
object.
This TG is scaled and rotated, so that the Rubik’s Cube is set a little
bit back and you can see three sides of the cube(left, right, top).
The mouse rotation and mouse zoom behaviour have a reference to this TG. So it is possible to rotate and zoom the cube.
For rotating the sides of the Rubik's Cube the picking mouse behavior
is added to the root.
( This behavior can only be added to BG nodes not to TG nodes ).
The cube pointer constructed with a cone and a cylinder and directed to the topmost little cube in the left corner, is also added to this TG. Is the cube pointer deselected the cube pointer node is detached from the TG. If it is selected again the node is added to the TG.
To the CubesTG node, whose father node is RubiksCubeTG, all the little
cubes are added. Each little cube has its own CubesTG node (To keep the
picture clear, only one CubesTG is shown).
Each CubesTG node is transformed, so that it sets the little cubes
to the right position.
( See also : “How
to draw the Rubik’s Cube " ?) .
The little cubes are real cubes. The real cube is a geometrical object
that we have generated. Dependent on the position of the little cube only
the visible sides are drawn. So our Rubik’s Cube is hollow.
