anki_vector.opengl.opengl

This module provides 3D support classes for OpenGL, used by opengl_viewer.py.

It uses PyOpenGL, a Python OpenGL 3D graphics library which is available on most platforms. It also depends on the Pillow library for image processing.

Warning

This package requires Python to have the PyOpenGL package installed, along with an implementation of GLUT (OpenGL Utility Toolkit).

To install the Python packages on Mac and Linux do python3 -m pip install --user "wirepod_vector_sdk[3dviewer]"

To install the Python packages on Windows do py -3 -m pip install --user "wirepod_vector_sdk[3dviewer]"

On Windows and Linux you must also install freeglut (macOS / OSX has one preinstalled).

On Linux: sudo apt-get install freeglut3

On Windows: Go to http://freeglut.sourceforge.net/ to get a freeglut.dll file. It’s included in any of the Windows binaries downloads. Place the DLL next to your Python script, or install it somewhere in your PATH to allow any script to use it.”

Functions

raise_opengl_or_pillow_import_error(...)

Classes

Camera(look_at, up, distance, pitch, yaw)

Class containing the state of a 3d camera, used to transform all object in a scene with relation to a particular point of view.

DynamicTexture()

Wrapper around An OpenGL Texture that can be dynamically updated.

Light(ambient_color, diffuse_color, ...[, ...])

Configuration for a light in the OpenGL scene that effects the shading of 3d geometry.

MaterialLibrary(resource_context, asset_key)

Load a .mtl material asset, and return the contents as a dictionary.

MeshData(resource_manager, asset_key)

The loaded / parsed contents of a 3D Wavefront OBJ file.

MeshFace(position_ids, normal_ids, tex_ids, ...)

A face polygon in 3d space - the basic building block of 3D models.

MeshGroup(name)

A colletions of face polygons which can be rendered as a group by name.

OpenGLWindow(x, y, width, height, window_name)

A Window displaying an OpenGL viewport.

PrecomputedView()

A collection of static 3D object which are pre-computed on the graphics card, so they can be quickly drawn when needed.

Projector(fov, near_clip_plane, far_clip_plane)

Configuration for how 3d objects are projected onto the 2d window.

ResourceManager(context_id)

Handles returning file resources by keys.

Exceptions

InvalidOpenGLGlutImplementation

Raised by OpenGLViewer if no valid GLUT implementation available.