Skip to content

jeertmans/manim-tutorial

Repository files navigation

Manim Tutorial Logo IEEE Student Branch UCLouvain Logo

This repository contains all the documents related to the Manim Tutorial given by the UCLouvain IEEE Student Branch. After reading this document, you should be able te reproduce everything that was presented during the tutorial.

Table of Contents

About Manim and ManimGL

From 3b1b's repo:

Manim is an engine for precise programmatic animations, designed for creating explanatory math videos.

Note, there are two versions of manim. This repository began as a personal project by the author of 3Blue1Brown for the purpose of animating those videos, with video-specific code available here. In 2020 a group of developers forked it into what is now the community edition, with a goal of being more stable, better tested, quicker to respond to community contributions, and all around friendlier to get started with. See this page for more details.

Hence, the community edition will be referred to as Manim, while the one authored by 3Blue1Brown will be referred to as ManimGL.

About this tutorial

This tutorial aims to give a rapid overview on what can be done with Manim in a few lines of code, but also with additional tools that can help you rapidly produce high quality video animations.

For the rest of the document, we assumed that:

  • you assisted the live tutorial or watched the video (link soon) or read through the slides (link soon)
  • you have basic knowledge in Python programming
  • you know how to open a terminal / command prompt

Additionally, it is good to know a bit about $\LaTeX$.

If you have any question, please feel free to reach us, see Report issues.

Installation Guidelines

In the following sections, we will guide you to the installation process, to later be able to reproduce everything that was presented during the live tutorial.

Prerequisites

For this tutorial to be successfully followed, you need a working Python installation, whose version is above or equal to 3.8 (¹). See here how to install Python.

Then, it is highly recommended, but not mandatory, to create a virtual environment (venv) and to install Python modules in it. If you don't know venv is, please check this page.

(¹): Python 3.7 can work, but not with ManimGL, see below.

Choosing between Manim and ManimGL

During the live tutorial, we presented two Python libraries / tools: Manim and ManimGL.

If you don't know what to choose between Manim (community edition) and ManimGL (3Blue1Brown edition), we highly recommend opting for Manim.

Why? For multiple reasons:

  • Easier cross-platform installation.
  • Does not require installing OpenGL.
  • Maintained by the community. Hence, more stable accross time, meaning that your recently created code is more likely to still work in 2 years with Manim than with ManimGL.
  • Very good documentation, see here.

Why not? Reasons to prefer ManimGL:

  • You want to reproduce some of 3b1b's videos, available on GitHub.
  • You need features that are (currently) only available with ManimGL.

How to install Manim

The Manim Community's website contains documentation detailing how to install Manim depending on your platform. Please find installation guidelines here in English or in French.

If you want to try out Manim before installing anything, go check their interactive tutorial available online.

How to install ManimGL

Warning: while ManimGL claims that they support Python versions above or equal to 3.7, it should be noted that the actual minimal Python version is 3.8.

3Blue1Brown's website contains documentation detailing how to install ManimGL depending on your platform. Please find installation guidelines here in English.

Note: while ManimGL is installed as manimgl, the python module is imported as manimlib.

Additional tools

Below, you will find additional tools that will, surely, make your experience with Manim even greater!

Create slides with Manim Slides

Manim Support: this tool works with Manim and ManimGL

To generate PowerPoint-like presentations, i.e, slides that you can play/pause/rewind/etc., you can use Manim Slides. This tool supports both Manim and ManimGL.

The installation process is straightforward:

pip install manim-slides

For more information on how to install and use Manim Slides, directly refer to the README.

Use Manim within Jupyter

Manim Support: this only works with Manim, not ManimGL

Manim can be used directly within Jupyter Notebook, see here. This enables faster development, and the possibility to create HTML slides containing Manim animations.

Actually, this tutorial slides were generated based on a Jupyter Notebook, read more in the README of the slides directory.

If you decided to work in a venv, you might need to add a kernel to Jupyter, so that you can use your venv within your notebooks (ref.: link):

pip install jupyter # if not done, this installs Jupyter Notebooks
ipython kernel install --name "your-env" --user

where "your-venv" refers to the name of your new kernel.

Then, you can now change the kernel in any notebook by clicking Kernel -> Change kernel -> your-env.

Manim Physics and more

On top of Manim and ManimGL, many users have created their own animations, libraries, tutorials, and so on.

To cite a few, we recommend checking:

  • Manim Physics, a physics simulation plugin for Manim
  • Reducible, a YouTuber that utilizes Manim for its videos YouTube Channel Subscribers
  • the Manim subreddit for questions and inspirations Manim Subreddit
  • the Manim Community discord for questions and inspirations Discord

Report issues

Did we write something wrong? Did you encounter some bugs following our tutorial? Do you think some content should be added?

First, check out our Wiki to see if your issue is known.

Otherwise, please contact us by creating an issue, or use our UCLouvain contact addresses (see above).