Camera

class pyrender.camera.Camera(znear=0.05, zfar=100.0, name=None)[source]

Bases: object

Abstract base class for all cameras.

Note

Camera poses are specified in the OpenGL format, where the z axis points away from the view direction and the x and y axes point to the right and up in the image plane, respectively.

Parameters:
  • znear (float) – The floating-point distance to the near clipping plane.
  • zfar (float) – The floating-point distance to the far clipping plane. zfar must be greater than znear.
  • name (str, optional) – The user-defined name of this object.

Attributes Summary

name The user-defined name of this object.
zfar The distance to the far clipping plane.
znear The distance to the near clipping plane.

Methods Summary

get_projection_matrix([width, height]) Return the OpenGL projection matrix for this camera.

Attributes Documentation

name

The user-defined name of this object.

Type:str
zfar

The distance to the far clipping plane.

Type:float
znear

The distance to the near clipping plane.

Type:float

Methods Documentation

get_projection_matrix(width=None, height=None)[source]

Return the OpenGL projection matrix for this camera.

Parameters:
  • width (int) – Width of the current viewport, in pixels.
  • height (int) – Height of the current viewport, in pixels.