Scene Graph Basics

What is a Scene Graph?

A scene graph is a directed acyclic graph (DAG) that consists of a collection of LVT Nodes arranged in a tree structure. A scene graph defines the objects in the 3D scene we wish to draw, and specifies their relationship to each other.

Scene graph Nodes are joined together via special nodes called Groups. A group is simply a collection of other Nodes (often including other Groups). When any action is applied to a Group (such as rendering or picking) that action is passed on to the Group's children in the order in which they were added to the group. Groups (and related Nodes, such as Separators) are the glue which hold scene graphs together.

A Simple Scene Graph Example

Let's take a look at how we can construct and display a 3D scene using a scene graph. This first example will display a cube in the center of the screen, and allow us to rotate it, and view it from multiple angles.

Our scene graph will consist of six parts: