Performer Scene Graphs

All Performer nodes are subclasses of pfNode. They include pfGroup, pfDCS, pfLightSource, pfGeode, etc.


Performer has multiple processes which make use of the scene graph and traverse it. The most significant ones for our purposes are the APP and DRAW stages.

APP performs application computations. It is where transformations are updated, switch states are changed, etc. These computations can be performed directly as part of the main loop of a program, or they can be part of the scene traversal via callback functions.

DRAW draws the scene. This is typically all handled by Performer, but special-purpose drawing code can be added to nodes as traversal callbacks.
Technically, the DRAW stage doesn't actually traverse the scene graph in the normal sense, but it will act like it does for node callbacks and state inheritance.



Callbacks and Traversals

 main
 {
  create scene graph
  node->setDrawCallback(myPreFunction, myPostFunction, myData)
  give scene graph to Performer for traversal
 }


 pfDrawTraverse(node)
 {
  if node has a pre-draw-callback
	preDrawCallbackFunction(node, callbackData)
  for each child of node
	pfDrawTraverse(node)
  if node has a post-draw-callback
	postDrawCallbackFunction(node, callbackData)
 }




Note: Performer's scene graph is actually a DAG (directed acyclic graph), not simply a tree, but we're going to ignore that for now.




Last modified 24 January 2000.
Dave Pape, pape@evl.uic.edu