Skip to main content

Camera Basics

The camera determines what is visible in your scene and from what perspective. ManimVTK provides different camera types for different needs.
For 2D scenes, the camera is mostly invisible. For 3D scenes, camera control is essential.

Camera Types

2D Camera (Scene)

The default camera for 2D scenes:
Characteristics:
  • Fixed perspective
  • Orthographic projection
  • Default view: looking down Z-axis

3D Camera (ThreeDScene)

Camera with full 3D control:
Characteristics:
  • Adjustable viewing angle
  • Can rotate around objects
  • Perspective projection

Moving Camera (MovingCameraScene)

Camera that can zoom and pan in 2D:

3D Camera Control

Setting Initial Orientation

Understanding angles:
  • phi: Vertical angle from Z-axis (0° = top, 90° = side)
  • theta: Horizontal rotation around Z-axis
  • distance: How far the camera is from the origin
  • gamma: Camera rotation (tilt)

Animating Camera Movement

Ambient Camera Rotation

Continuous rotation for showcasing 3D objects:
Rate parameter:
  • Positive: Counter-clockwise rotation
  • Negative: Clockwise rotation
  • Typical values: 0.1 to 0.3

Camera at a Specific Point

Point camera at an object:

Moving Camera (2D)

Frame Control

Zooming

Following Objects

Camera Presets

Common 3D Views

Reset Camera

Advanced Techniques

Camera Along Path

Combine Zoom and Pan

Smooth Camera Transitions

Best Practices

  • 2D content: Use standard Scene
  • 3D objects: Use ThreeDScene with good phi/theta
  • Detail work: Use MovingCameraScene to zoom
Set initial camera position that shows your object well:

Camera Configuration

Via Code

Via Config File

Common Patterns

Orbit Around Object

Zoom to Detail

Pan Across Scene

Next Steps

Renderers

Learn about different rendering backends

3D Scenes

ThreeDScene API reference

Examples

See camera control examples

VTK Renderer

VTK rendering for 3D