Esempio n. 1
0
 def setup(self):
     self.camera_frame = ScreenRectangle(height = FRAME_HEIGHT)
     self.camera_frame.set_stroke(width = 0)
     self.camera = MovingCamera(
         self.camera_frame, **self.camera_config
     )
     return self
Esempio n. 2
0
 def setup_zoomed_camera(self):
     self.little_rectangle = self.big_rectangle.copy()
     self.little_rectangle.scale(1. / self.zoom_factor)
     self.little_rectangle.move_to(self.little_rectangle_start_position)
     self.zoomed_camera = MovingCamera(
         self.little_rectangle,
         pixel_shape=self.zoomed_canvas_pixel_shape,
         background=self.zoomed_camera_background)
     self.add(self.little_rectangle)
     #TODO, is there a better way to hanld this?
     self.zoomed_camera.adjusted_thickness = lambda x: x
Esempio n. 3
0
    def setup(self):
        MovingCameraScene.setup(self)
        # Initialize camera and display
        zoomed_camera = MovingCamera(**self.zoomed_camera_config)
        zoomed_display = ImageMobjectFromCamera(
            zoomed_camera, **self.zoomed_camera_image_mobject_config)
        zoomed_display.add_display_frame()
        for mob in zoomed_camera.frame, zoomed_display:
            mob.stretch_to_fit_height(self.zoomed_display_height)
            mob.stretch_to_fit_width(self.zoomed_display_width)
        zoomed_camera.frame.scale(self.zoom_factor)

        # Position camera and display
        zoomed_camera.frame.move_to(self.zoomed_camera_frame_starting_position)
        if self.zoomed_display_center is not None:
            zoomed_display.move_to(self.zoomed_display_center)
        else:
            zoomed_display.to_corner(self.zoomed_display_corner,
                                     buff=self.zoomed_display_corner_buff)

        self.zoomed_camera = zoomed_camera
        self.zoomed_display = zoomed_display