본문 바로가기

Programming/Manim Lectures

[06-3] Animation by Object Updating

반응형

One of the best features of Manim animation is to control and animate the changes of objects in each scene. It's all about applying this technique to keep the object's color changing, move its position, change the number continuously like a digital timer, and let the tangent move along the line of the graph.

 

The basic principle is to create a function that changes the properties (color, position, etc.) of the object, so that this function gets involved whenever the frame of the video changes.

 

The rendering principle of making a movie in Manim is to create multiple image frames, and n frames are collected to create a movie for 1 second. At this time, the size of n is determined by whether -l or -m is used in the rendering options.

The appearance of objects per frame is determined by the update function of the object class. If the content of this update function is supposed to change color or move its position as the frame progresses, the object in the final video is an animation that changes its position over time and changes its position.

 

The point is that we can animate the object's changing state by the object's update function.

 

There are three ways to change the object's state per each frame.

  • Assigning a function through the object's add_updater method: mob.add_updater(func)
  • Redraw a object per each frame using always_redraw method: mob.always_redraw(func)
  • Use animatin class for update in Scene.play method: self.play(UpdateFromFunc(mob, func))

 [06-3-A] Use add_updater

 [06-3-B] Use always_redraw

 [06-3-C] Use Updating Class

 


Next: [06-3-A] Use add_updater

 

[06-3-A] Use add_updater

The Mobject class has an add_updater method, which allows you to specify a function that will be executed whenever the object changes the video frame. manilib.mobject.mobject.Mobject.add_updater(sel..

infograph.tistory.com

Go To: [99] Table of Contents

반응형

'Programming > Manim Lectures' 카테고리의 다른 글

[06-3-B] Use always_redraw  (0) 2020.06.09
[06-3-A] Use add_updater  (0) 2020.06.09
[06-2] Animation by Object's Method  (0) 2020.06.09
[06-1-I] Animation : Special Effect  (0) 2020.06.09
[06-1-H] Animation : Grouping  (0) 2020.06.09