mirror of
https://github.com/ManimCommunity/manim.git
synced 2026-06-22 10:01:47 +00:00
212 lines
10 KiB
Text
212 lines
10 KiB
Text
|
|
msgid ""
|
|
msgstr ""
|
|
"Project-Id-Version: Manim \n"
|
|
"MIME-Version: 1.0\n"
|
|
"Content-Type: text/plain; charset=UTF-8\n"
|
|
"Content-Transfer-Encoding: 8bit\n"
|
|
|
|
#: ../../source/tutorials/quickstart.rst:3
|
|
msgid "Quickstart"
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:6
|
|
msgid "Before proceeding, install Manim and make sure it's running properly by following the steps in :doc:`../installation`. For information on using Manim with Jupyterlab or Jupyter notebook, go to the documentation for the :meth:`IPython magic command <manim.utils.ipython_magic.ManimMagic.manim>`, ``%%manim``."
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:14
|
|
msgid "Overview"
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:16
|
|
msgid "This quickstart guide will lead you through creating a sample project using Manim: an animation engine for precise programmatic animations."
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:19
|
|
msgid "First, you will use a command line interface to create a ``Scene``, the class through which Manim generates videos. In the ``Scene`` you will animate a circle. Then you will add another ``Scene`` showing a square transforming into a circle. This will be your introduction to Manim's animation ability. Afterwards, you will position multiple mathematical objects (``Mobject``\\s). Finally, you will learn the ``.animate`` syntax, a powerful feature that animates the methods you use to modify ``Mobject``\\s."
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:29
|
|
msgid "Starting a new project"
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:31
|
|
msgid "Start by creating a new folder. For the purposes of this guide, name the folder ``project``:"
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:37
|
|
msgid "This folder is the root folder for your project. It contains all the files that Manim needs to function, as well as any output that your project produces."
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:42
|
|
msgid "Animating a circle"
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:44
|
|
msgid "Open a text editor, such as Notepad. Copy the following code snippet into the window:"
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:57
|
|
msgid "Save the code snippet into your project folder with the name ``scene.py``."
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:64
|
|
msgid "3. Open the command line, navigate to your project folder, and execute the following command:"
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:71
|
|
msgid "Manim will output rendering information, then create an MP4 file. Your default movie player will play the MP4 file, displaying the following animation."
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:83
|
|
msgid "If you see an animation of a pink circle being drawn, congratulations! You just wrote your first Manim scene from scratch."
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:86
|
|
msgid "If you get an error message instead, you do not see a video, or if the video output does not look like the preceding animation, it is likely that Manim has not been installed correctly. Please refer to the :doc:`../installation/troubleshooting` page for more information."
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:95
|
|
msgid "Explanation"
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:97
|
|
msgid "Let's go over the script you just executed line by line to see how Manim was able to draw the circle."
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:100
|
|
msgid "The first line imports all of the contents of the library:"
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:106
|
|
msgid "This is the recommended way of using Manim, as a single script often uses multiple names from the Manim namespace. In your script, you imported and used ``Scene``, ``Circle``, ``PINK`` and ``Create``."
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:110
|
|
msgid "Now let's look at the next two lines:"
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:118
|
|
msgid "Most of the time, the code for scripting an animation is entirely contained within the :meth:`~.Scene.construct` method of a :class:`.Scene` class. Inside :meth:`~.Scene.construct`, you can create objects, display them on screen, and animate them."
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:122
|
|
msgid "The next two lines create a circle and set its color and opacity:"
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:129
|
|
msgid "Finally, the last line uses the animation :class:`.Create` to display the circle on your screen:"
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:136
|
|
msgid "All animations must reside within the :meth:`~.Scene.construct` method of a class derived from :class:`.Scene`. Other code, such as auxiliary or mathematical functions, may reside outside the class."
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:142
|
|
msgid "Transforming a square into a circle"
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:144
|
|
msgid "With our circle animation complete, let's move on to something a little more complicated."
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:146
|
|
msgid "Open ``scene.py``, and add the following code snippet below the ``CreateCircle`` class:"
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:162
|
|
msgid "Render ``SquareToCircle`` by running the following command in the command line:"
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:168
|
|
#: ../../source/tutorials/quickstart.rst:216
|
|
#: ../../source/tutorials/quickstart.rst:284
|
|
#: ../../source/tutorials/quickstart.rst:326
|
|
msgid "The following animation will render:"
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:185
|
|
msgid "This example shows one of the primary features of Manim: the ability to implement complicated and mathematically intensive animations (such as cleanly interpolating between two geometric shapes) with just a few lines of code."
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:191
|
|
msgid "Positioning ``Mobject``\\s"
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:193
|
|
msgid "Next, let's go over some basic techniques for positioning ``Mobject``\\s."
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:195
|
|
msgid "Open ``scene.py``, and add the following code snippet below the ``SquareToCircle`` method:"
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:210
|
|
msgid "Render ``SquareAndCircle`` by running the following command in the command line:"
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:232
|
|
msgid "``next_to`` is a ``Mobject`` method for positioning ``Mobject``\\s."
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:234
|
|
msgid "We first specified the pink circle as the square's reference point by passing ``circle`` as the method's first argument. The second argument is used to specify the direction the ``Mobject`` is placed relative to the reference point. In this case, we set the direction to ``RIGHT``, telling Manim to position the square to the right of the circle. Finally, ``buff=0.5`` applied a small distance buffer between the two objects."
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:240
|
|
msgid "Try changing ``RIGHT`` to ``LEFT``, ``UP``, or ``DOWN`` instead, and see how that changes the position of the square."
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:242
|
|
msgid "Using positioning methods, you can render a scene with multiple ``Mobject``\\s, setting their locations in the scene using coordinates or positioning them relative to each other."
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:246
|
|
msgid "For more information on ``next_to`` and other positioning methods, check out the list of :class:`.Mobject` methods in our reference manual."
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:251
|
|
msgid "Using ``.animate`` syntax to animate methods"
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:253
|
|
msgid "The final lesson in this tutorial is using ``.animate``, a ``Mobject`` method which animates changes you make to a ``Mobject``. When you prepend ``.animate`` to any method call that modifies a ``Mobject``, the method becomes an animation which can be played using ``self.play``. Let's return to ``SquareToCircle`` to see the differences between using methods when creating a ``Mobject``, and animating those method calls with ``.animate``."
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:260
|
|
msgid "Open ``scene.py``, and add the following code snippet below the ``SquareAndCircle`` class:"
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:278
|
|
msgid "Render ``AnimatedSquareToCircle`` by running the following command in the command line:"
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:299
|
|
msgid "The first ``self.play`` creates the square. The second animates rotating it 45 degrees. The third transforms the square into a circle, and the last colors the circle pink. Although the end result is the same as that of ``SquareToCircle``, ``.animate`` shows ``rotate`` and ``set_fill`` being applied to the ``Mobject`` dynamically, instead of creating them with the changes already applied."
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:305
|
|
msgid "Try other methods, like ``flip`` or ``shift``, and see what happens."
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:307
|
|
msgid "Open ``scene.py``, and add the following code snippet below the ``AnimatedSquareToCircle`` class:"
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:320
|
|
msgid "Render ``DifferentRotations`` by running the following command in the command line:"
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:338
|
|
msgid "This ``Scene`` illustrates the quirks of ``.animate``. When using ``.animate``, Manim actually takes a ``Mobject``'s starting state and its ending state and interpolates the two. In the ``AnimatedSquareToCircle`` class, you can observe this when the square rotates: the corners of the square appear to contract slightly as they move into the positions required for the first square to transform into the second one."
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:344
|
|
msgid "In ``DifferentRotations``, the difference between ``.animate``'s interpretation of rotation and the ``Rotate`` method is far more apparent. The starting and ending states of a ``Mobject`` rotated 360 degrees are the same, so ``.animate`` tries to interpolate two identical objects and the result is the left square. If you find that your own usage of ``.animate`` is causing similar unwanted behavior, consider using conventional animation methods like the right square, which uses ``Rotate``."
|
|
msgstr ""
|
|
|
|
#: ../../source/tutorials/quickstart.rst:353
|
|
msgid "You're done!"
|
|
msgstr ""
|
|
|
|
|