INNER CODE UNIT · Python

PrimitivesExample

mosra/magnum-examples · src/python/magnum-primitives.py:37

class PrimitivesExample(Application):
    def __init__(self):
        Application.__init__(self, self.Configuration(
            title="Magnum Python Primitives Example"
        ))

        gl.Renderer.enable(gl.Renderer.Feature.DEPTH_TEST)
        gl.Renderer.enable(gl.Renderer.Feature.FACE_CULLING)

        self._mesh = meshtools.compile(primitives.cube_solid())
        self._shader = shaders.PhongGL()

        self._transformation = (
            Matrix4.rotation_x(Deg(30.0))@
            Matrix4.rotation_y(Deg(40.0)))
        self._projection = (
            Matrix4.perspective_projection(
                fov=Deg(35.0), aspect_ratio=1.33333, near=0.01, far=100.0)@

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…