Skip to contents

A 3D camera with spherical coordinates (phi, theta, gamma) and perspective projection.

Super class

manimR::Camera -> ThreeDCamera

Public fields

phi

Polar angle from Z-axis (0 = top-down, PI/2 = horizontal)

theta

Azimuthal angle around Z-axis

gamma

Roll angle

focal_distance

Distance from camera to focal point

zoom

3D zoom factor

light_source

Position of the light source

Methods

Inherited methods


Method new()

Create a ThreeDCamera

Usage

ThreeDCamera$new(
  phi = 0,
  theta = -PI/2,
  gamma = 0,
  focal_distance = 5,
  zoom = 1,
  ...
)

Arguments

phi

Polar angle

theta

Azimuthal angle

gamma

Roll angle

focal_distance

Focal distance

zoom

Zoom factor

...

Passed to Camera


Method set_euler_angles()

Set spherical camera angles

Usage

ThreeDCamera$set_euler_angles(phi = NULL, theta = NULL, gamma = NULL)

Arguments

phi

Polar angle

theta

Azimuthal angle

gamma

Roll angle


Method get_position()

Get the camera position in Cartesian coordinates

Usage

ThreeDCamera$get_position()


Method get_rotation_matrix()

Get the 3x3 rotation matrix for the camera orientation

Usage

ThreeDCamera$get_rotation_matrix()


Method project_point()

Project a 3D point to 2D screen coordinates

Usage

ThreeDCamera$project_point(point)

Arguments

point

3D point c(x, y, z)

Returns

2D point c(x, y) in screen coordinates


Method project_points()

Project a matrix of 3D points to 2D

Usage

ThreeDCamera$project_points(points)

Arguments

points

Matrix (N x 3)

Returns

Matrix (N x 2)


Method print()

Print 3D camera summary

Usage

ThreeDCamera$print()


Method clone()

The objects of this class are cloneable with this method.

Usage

ThreeDCamera$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.