Skip to content
Alessandro Febretti edited this page Sep 21, 2013 · 44 revisions

Last revision: ver. 4.2-alpha6 - 28 August 2013

omegalib exposes most of its API to Python, so the vast majority of omegalib applications are developed as python scripts. Using python instead of C++ to develop your omegalib application offers several advantages:

  • You can port your application to different systems without recompiling. For instance you can develop a script on your laptop, then copy it to CAVE2 and just launch it. Configuration files will do the rest.
  • You can modify your application at runtime using the interactive python console
  • If you need integration with C++ or need access to advanced omegalib functionality, you can write C++ code as an omegalib module and import it into your python script.

omegalib uses its own python interpreter to run python scripts. The interpreter executable is called orun, and is built with omegalib when you enable python support.

Running python omegalib programs: orun

To run python omegalib programs, you need the orun application. orun is part of the standard omegalib distribution. You have two ways to start a script using orun:

  • Though the command line using a command in the form: orun -s <filepath.py>
  • After starting orun, typing: :r <applicationName>. This is an example of a quick command. For more information on quick commands check the QuickCommands page.

To stop an orun program, press esc, type oexit() or :q or press control-C (on linux) at the orun console, or run orun -K on another terminal.

omegalib Python Reference

module omega

[[module omega | Python-Reference#module-omega]] contains all the core functionality of omegalib like scene graph management and event handling. It also offers a few utility functions to manage verious aspects of an omegalib application. omega is always imported by default in omegalib applications, so you do not need to write any import statement to access its classes and functions.

Core . .
Callbacks Application Control Data Access
Event Color MissionControlClient
Core Scene Other
Callbacks SceneNode Sound Management
Application Control Camera Diagnostics and Configuration
Data Access Actor DrawInterface
Event CameraController Font
Color PixelData
MissionControlClient DisplayConfig
DisplayTileConfig
Math
[Vector] Quaternion Matrix
[Point] Plane [Line, Ray, LineSegment]
Circle Sphere Misc Math Functions

module omegaToolkit

omegaToolkit is a utility module for omegalib. It exposes some non-core functionalities such as

  • a 2D / 3D graphical user interface
  • a set of object manipulator techniques based on mouse / touch, 3d wands and kinect tracking
General GUI Menu System
omegaToolkit Functions Container3dSettings MenuManager
ToolkitUtils UiModule Menu
PortholeService WidgetFactory MenuItem
Widget
Container
Button
Label
Image
Slider

module cyclops

Cyclops is a utility library that sits on top of omegalib and OpenSceneGraph. It is designed to speed-up development of simple graphical applications, without having to deal with the low-level details of osg. In a sense, cyclops is the GLUT library of omegalib. Some of cyclops features are:

  • Support for loading scenes defined in a simple xml format
  • Easy creation of primitive shapes, like planes, spheres, cubes and so on
  • Out-of-the-box support for soft shadows
  • An expandable shaders and effects library
Entities Materials and Shading Core
Entity ProgramAsset cyclops misc functions
SphereShape Uniform SceneManager
PlaneShape Uniforms ModelLoader
BoxShape Material ModelInfo
CylinderShape Light
LineSet ShadowSettings
StaticObject SkyBox
AnimatedObject ModelGeometry
Text3D
Clone this wiki locally