Skip to contents

Rotates a camera's eye position and up vector around its center by a given angle about a rotation axis. Useful for generating turntable-style frame sequences.

Usage

camera_orbit(camera, axis = c(0, 0, 1), angle_degrees)

Arguments

camera

A camera list from camera() or camera_auto().

axis

Rotation axis as a length-3 vector. Default c(0, 0, 1) (Z axis).

angle_degrees

Rotation angle in degrees.

Value

A camera list with S3 class "scimesh_camera".

Examples

mesh <- generate_torus(c(0, 0, 0))
cam <- camera_auto(mesh, direction = c(1, 1, 1))
cam2 <- camera_orbit(cam, axis = c(0, 0, 1), angle_degrees = 90)