Interactive Media Systems, TU Wien

Pivy - Embedding a Dynamic Scripting Language into a Scene Graph Library

Thesis by Tamer Fahmy

Supervision by Dieter Schmalstieg and Hannes Kaufmann


This thesis presents the design and implementation of "Pivy": a Python language binding for the Coin scene graph library. Pivy allows for development of Coin applications in Python, interactive modification of Coin programs from within the Python interpreter at runtime and incorporation of Scripting Nodes - capable of executing Python code and callback functions - into the scene graph. Coin is a high-level 3D graphics toolkit for developing cross-platform real-time 3D visualization and visual simulation software; Coin´s properties and features are e.g. suitable for application development in the Augmented Reality (AR) domain. We differentiate between extending and embedding the Python interpreter. To create a Python extension, a C wrapper needs to be written and built as a shared library; Python then imports and makes use of this shared library at runtime. Different Python wrapping techniques and approaches - from manual wrapping to automatic wrapper generators such as SWIG - with a special focus upon large C++ libraries/frameworks applicable for Python are compared. The opposite direction is called embedding, where already existing Coin applications or libraries (written in C++) are given direct access to the Python interpreter. Both use cases are showcased and their distinction explained through Python applications using Pivy and the special SoPyScript scene graph node which has been created to allow Python code to be embedded into a regular scene graph and executed during traversal of the same. The SoPyScript scene graph node is making use of both extending and embedding techniques; it is based upon ideas of the VRML JavaScript node and can be used from either Python or C++ applications. Furthermore, the suitability and benefits of dynamically typed "scripting" languages over statically typed "system programming" languages such as C++ for Rapid Application Development (RAD) and Rapid Application Prototyping (RAP) are analyzed and demonstrated.


T. Fahmy: "Pivy - Embedding a Dynamic Scripting Language into a Scene Graph Library"; Supervisor: D. Schmalstieg, H. Kaufmann; Institut für Softwaretechnik und Interaktive Systeme, E188/2, 2006.


Click into the text area and press Ctrl+A/Ctrl+C or ⌘+A/⌘+C to copy the BibTeX into your clipboard… or download the BibTeX.