3b1b/videos: Exploring the Code Behind 3Blue1Brown's Math Animations

3b1b/videos: Exploring the Code Behind 3Blue1Brown's Math Animations

Summary

The 3b1b/videos repository hosts the Python code used to generate the captivating mathematical animations featured in 3Blue1Brown's educational videos. Primarily utilizing the Manim library, this project offers a unique insight into the creation process of complex visual explanations. It serves as an invaluable resource for those interested in mathematical visualization and the Manim animation engine.

Repository Info

Updated on November 4, 2025
View on GitHub

Tags

Click on any tag to explore related repositories

Introduction

The 3b1b/videos GitHub repository provides the source code for the visually stunning mathematical animations seen in the popular 3Blue1Brown YouTube channel. This project is almost entirely built using the Manim library, a powerful tool for programmatic animation. It offers an unparalleled opportunity to delve into the intricate details of how complex mathematical concepts are brought to life through animation.

Installation

While this repository contains the scene code, the core animation engine is the Manim library. To run and experiment with these scenes, you will first need to install Manim. The repository's README directs users to the official Manim repository for installation instructions, specifically mentioning 3b1b/manim and the community-maintained ManimCommunity/manim. Grant Sanderson, the creator of 3Blue1Brown, also provides a video walkthrough of his workflow, which is highly recommended for understanding the setup.

Examples

The repository's README details a unique workflow centered around manimgl and an interactive mode. Users can run manimgl (file name) (scene name) -se (line_number) to enter a debugger-like interactive session. A key feature is the checkpoint_paste() function, which allows users to paste code snippets from their clipboard into the interactive terminal. This function can save scene states and revert to them, enabling efficient iteration and debugging of animations. The README also includes specific instructions for integrating this workflow with the Sublime Text editor, demonstrating how custom commands and keybindings can streamline the animation development process.

# Example of manimgl command
manimgl my_scene_file.py MyScene -se 123
# Example of checkpoint_paste() usage
# Copy this to clipboard and paste into manimgl interactive terminal
# This is a comment
self.play(FadeIn(my_object))

Why Use

This repository is an essential resource for anyone looking to understand the technical artistry behind 3Blue1Brown's acclaimed videos. Developers and educators can explore advanced Manim usage, learn best practices for mathematical visualization, and adapt existing scenes for their own educational content. It serves as a practical guide and an inspiring example of how code can be used to explain complex ideas with clarity and beauty. Furthermore, it's a great starting point for those wanting to contribute to or learn from a high-quality open-source project in the realm of educational technology.

Links