MedicalVisualization
Scene Graph to Open GL
‹ OpenGL Matrix Stack | ● | Scene Graph APIs ›
A scene graph can be translated into direct rendering commands by following these simple guide lines:
- Apply the camera transformation first
- Walk the graph depth-first (by always keeping one hand on the “railing”).
- Whenever a transformation node is traversed down-wards, remember the actual modelling transformation (by issuing a glPushMatrix command). Then apply the respective local transformation.
- Whenever a geometry node is traversed down-wards, render it with the actual modelling transformation.
- Whenever a transformation node is traversed up-wards, restore the previous modelling transformation (by issuing a glPopMatrix command).
For example the following scene graph
is translated into the following direct OpenGL command sequence
‹ OpenGL Matrix Stack | ● | Scene Graph APIs ›