inventor.SceneManager
class SceneManager(object)
Handles the display and interactions with scene graphs. Scene manager instances are used in an application to attach scene graphs to OpenGL windows for display and user interaction (using GLUT for example).Methods defined here:
init_gl(...)
Initializes an OpenGL context for rendering.interaction(...)
Sets the mouse interaction mode.Args:
-
Interaction mode (0 = SCENE, 1 = CAMERA). By default all events
are forwarded to the scene graph for processing. Setting the mode
to 1 allows rotating the camera around the focal point and zooming
with the scroll wheel.
key(...)
Sends keyboard event into the scene for processing.Args:
-
Pressed keyboard character.
Note:
-
Pass this function to glutKeyboardFunc() in GLUT applications.
motion3(...)
Sends a 3D motion event into the scene for processing.Args:
- translation: 3D translation as tuple or array.
- axis: Rotation axis as tuple or array.
- angle: Rotation angle.
mouse_button(...)
Sends mouse button event into the scene for processing.Args:
- button: Button index (0 = left, 1 = middle, 2 = right).
- state: Button state (0 = pressed, 1 = released).
- x, y: Mouse position in pixel viewport coordinates.
Note:
-
Pass this function to glutMouseFunc() in GLUT applications.
mouse_move(...)
Sends mouse move event into the scene for processing.Args:
- x, y: Mouse position in pixel viewport coordinates.
Note:
-
Pass this function to glutMotionFunc() in GLUT applications.
render(...)
Renders the scene into an OpenGL context.Args:
-
Optionally two boolean flags can be passed as arguments indicating
if color and depth buffer should be cleared before rendering the
scene.
resize(...)
Sets the window size.Args:
-
Window width and height in pixel.
view_all(...)
Initializes camera so that the entire scene is visible.Args:
-
Optionally a node can be passed as argument instead of using the
scene managers graph.
Data descriptors defined here:
background
Background color. Also two colors can be given thereby creating a gradient background.redisplay
Render callback object.The render callback object is invoked whenever the managed scene graph changes and needs to be re-rendered. When using GLUT for example, it should be set to glutPostRedisplay.