INNER CODE UNIT · Python
__init__
mosra/magnum-examples · src/python/magnum-primitives-scenegraph.py:60
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(
fov=Deg(35.0), aspect_ratio=1.33333, near=0.01, far=100.0)