Код: Выделить всё
class CameraFocusing(Scene):
def construct(self):
s = Square(color=YELLOW).move_to(np.array([-4,0,0]))
c = Circle().move_to(np.array([4,0,0]))
self.add(s,c)
self.wait(3)
self.camera.frame_center = s.get_center()
self.wait(3)
self.play(self.camera.frame.animate.shift(8 * RIGHT))
self.wait(2)
if __name__ == "__main__":
config.pixel_height = 720
config.pixel_width = 1280
config.frame_height = 7.0
config.frame_width = 7.0
config.frame_center = [-4, 0, 0]
config.background_color = BLACK
config.pixel_height = 720
config.pixel_width = 1280
config.save_as_gif = True
config.quality = "medium"
config.media_height = 7.0
config.media_width = 7.0
scene = CameraFocusing()
scene.render()
< /code>
Но всякий раз, когда я пытаюсь выполнить это, я получаю эту ошибку атрибута:-< /p>
attributeerror: 'camera' объект не имеет атрибута 'кадр'
Подробнее здесь: https://stackoverflow.com/questions/773 ... ing-camera
Мобильная версия