C481 B581 Computer Graphics
Dana Vrajitoru

Scene Graphs

Def. A scene graph is a n-ary tree where 
  • each leaf is 
    • either a geometrical object
      or a property (sometimes); 
  • the structure reflects a physical relation between the objects.

Example:


 
Properties in scene graphs can be
  • either physical properties (color, surface properties, transparency, etc.)
  • or geometrical properties, i.e. transformations.


While descending in the tree:

  • physical properties are inherited, unless redefined,
  • transformations are composed .

Scene Graphs in OpenGL
glPushMatrix();
 glPopMatrix(); 
OOP for Scene Graphs
Leaf Nodes
Container Nodes
Example: DataViewer
Containers in DV

Display Lists

Def. A display list is a group of OpenGL commands that have been stored for later execution. When a display list is invoked, the commands in it are executed in the order in which they were issued.

Useful for objects that will be drawn more than once.

Start a new display list:
glNewList(GLuint name, GLenum mode);

End the current display list
void glEndList();

mode can be
 
GL_COMPILE The commands in the list will not be executed as they are stored in the display list.
GL_COMPILE_AND_EXECUTE The commands will be executed as they are stored in the display list.

Execute a display list:
void glCallList(GLuint name);