MovingCamera

Qualified name: manim.camera.moving\_camera.MovingCamera

class MovingCamera(frame=None, fixed_dimension=0, default_frame_stroke_color='#FFFFFF', default_frame_stroke_width=0, **kwargs)[source]

Bases: manim.camera.camera.Camera

Stays in line with the height, width and position of it’s ‘frame’, which is a Rectangle

Frame is a Mobject, (should almost certainly be a rectangle) determining which region of space the camera displays

Methods

cache_cairo_context

Since the frame can be moving around, the cairo context used for updating should be regenerated at each frame.

capture_mobjects

Capture mobjects by printing them on pixel_array.

get_cached_cairo_context

Since the frame can be moving around, the cairo context used for updating should be regenerated at each frame.

get_mobjects_indicating_movement

Returns all mobjects whose movement implies that the camera should think of all other mobjects on the screen as moving

Attributes

background_color

background_opacity

frame_center

Returns the centerpoint of the frame in cartesian coordinates.

frame_height

Returns the height of the frame.

frame_width

Returns the width of the frame

cache_cairo_context(pixel_array, ctx)[source]

Since the frame can be moving around, the cairo context used for updating should be regenerated at each frame. So no caching.

capture_mobjects(mobjects, **kwargs)[source]

Capture mobjects by printing them on pixel_array.

This is the essential function that converts the contents of a Scene into an array, which is then converted to an image or video.

Parameters
  • mobjects (Mobject) – Mobjects to capture.

  • kwargs (Any) – Keyword arguments to be passed to get_mobjects_to_display().

Notes

For a list of classes that can currently be rendered, see display_funcs().

property frame_center

Returns the centerpoint of the frame in cartesian coordinates.

Returns

The cartesian coordinates of the center of the frame.

Return type

np.array

property frame_height

Returns the height of the frame.

Returns

The height of the frame.

Return type

float

property frame_width

Returns the width of the frame

Returns

The width of the frame.

Return type

float

get_cached_cairo_context(pixel_array)[source]

Since the frame can be moving around, the cairo context used for updating should be regenerated at each frame. So no caching.

get_mobjects_indicating_movement()[source]

Returns all mobjects whose movement implies that the camera should think of all other mobjects on the screen as moving

Returns

Return type

list