IntrinsicsCamera

class pyrender.IntrinsicsCamera(fx, fy, cx, cy, znear=0.05, zfar=100.0, name=None)[source]

Bases: pyrender.camera.Camera

A perspective camera with custom intrinsics.

Parameters:
  • fx (float) – X-axis focal length in pixels.
  • fy (float) – Y-axis focal length in pixels.
  • cx (float) – X-axis optical center in pixels.
  • cy (float) – Y-axis optical center in pixels.
  • znear (float) – The floating-point distance to the near clipping plane. If not specified, defaults to 0.05.
  • zfar (float) – The floating-point distance to the far clipping plane. zfar must be greater than znear. If not specified, defaults to 100.0.
  • name (str, optional) – The user-defined name of this object.

Attributes Summary

cx X-axis optical center in pixels.
cy Y-axis optical center in pixels.
fx X-axis focal length in meters.
fy Y-axis focal length in meters.
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

cx

X-axis optical center in pixels.

Type:float
cy

Y-axis optical center in pixels.

Type:float
fx

X-axis focal length in meters.

Type:float
fy

Y-axis focal length in meters.

Type:float
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, height)[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.