INNER CODE UNIT · Python
PrimitivesSceneGraphExample
mosra/magnum-examples · src/python/magnum-primitives-scenegraph.py:59
class PrimitivesSceneGraphExample(Application):
def __init__(self):
Application.__init__(self, self.Configuration(
title="Magnum Python Primitives + SceneGraph Example"
))
gl.Renderer.enable(gl.Renderer.Feature.DEPTH_TEST)
gl.Renderer.enable(gl.Renderer.Feature.FACE_CULLING)
# Scene and drawables
self._scene = Scene3D()
self._drawables = scenegraph.DrawableGroup3D()
# Camera setup
camera_object = Object3D(parent=self._scene)
camera_object.translate(Vector3.z_axis(10.0))
self._camera = scenegraph.Camera3D(camera_object)
self._camera.projection_matrix = Matrix4.perspective_projection(