[HN Gopher] Manim: An animation engine for explanatory math videos
___________________________________________________________________
Manim: An animation engine for explanatory math videos
Author : agmm
Score : 548 points
Date : 2021-08-20 12:32 UTC (1 days ago)
(HTM) web link (github.com)
(TXT) w3m dump (github.com)
| stevenpetryk wrote:
| Shameless plug for my React library for creating similar-looking,
| interactive visualizations on the web. Highly inspired by
| 3blue1brown/manim's style. Less focused around animation, more
| focused on interaction. :)
|
| https://mafs.dev/
|
| Edit: probably needs a bit of chores done, especially around
| typescript declaration organization. I built it during a brief
| 3-week funemployment last year. Side projects are hard!
| da39a3ee wrote:
| That looks like a really nice project. Are you familiar with
| Mathbox https://github.com/unconed/mathbox?
| stevenpetryk wrote:
| Nope! I like Three.js though. These visualizations are pretty
| intense.
| Uehreka wrote:
| I'm pretty sure mathbox got abandoned when mathbox2 came out
| (understandably, it's mostly one guy building it). But then
| mathbox2 appears to be abandoned now, and last time I tried
| to use it (a couple years ago) the coffeescript would no
| longer compile.
|
| It was a really visionary piece of work, it's a bummer to see
| it fall apart like this, and I don't think anything has come
| out since that really replaces it (though manim does look
| cool).
| 6gvONxR4sf7o wrote:
| That looks super clean. Very cool.
| tenaciousDaniel wrote:
| This is great, do you use anything under the hood? D3/ThreeJS?
| stevenpetryk wrote:
| SVG. It's remarkably powerful given that it supports
| arbitrary linear transformations and all sorts of computer
| graphics things.
| westoncb wrote:
| Can anyone give a brief explanation of what it means to use
| SVG in this context?
|
| I think of it as a file format, but I'm assuming no files
| are involved here. Aside from that I've noticed the
| contents of SVG files look similar to the 2d canvas
| operations--which to my mind seems like the natural thing
| to use for something like this--so why use SVG instead? And
| is there any relationship between canvas drawing and SVG?
| stevenpetryk wrote:
| SVG works much more naturally with React, since it's able
| to be managed via the DOM. Doesn't have to be an <img />.
| remram wrote:
| JavaScript can write SVG just like it writes HTML. Your
| React render() can return <svg><rect ... /></svg> as
| easily as <div><p>...</p></div>
| tenaciousDaniel wrote:
| Yep, svg + react = declarative graphics. I love it. I
| used it to replace D3 in a project I worked on last year
| and no regrets at all.
| nighthawk454 wrote:
| glancing at the code, it appears to just be SVG. and pretty
| cleanly at that
| jimmySixDOF wrote:
| I think there is a lot possible with a ThreeJS approach for
| DataViz. For instance there is a project [1] to have R
| implemented in A-Frame [2] (a simplified HTML like framework
| for ThreeJS). 3D in AR/VR is definitely a whole new visual
| language space for education such as the work by
| FlowImmersve's TicTok Data Guy [3].
|
| [1] https://github.com/ACEMS/r2vr
|
| [2] https://aframe.io/
|
| [3] https://www.tiktok.com/@the.data.guy
| pc86 wrote:
| Haven't looked at the code yet but the animations/interactivity
| is gorgeous.
| [deleted]
| dxbydt wrote:
| Your example on Projectile motion and Riemann sum is quite
| nice! I am going to share it with a few kids I work with. Thank
| you for creating this.
| enbugger wrote:
| I see that the 3D animations in 3Brown1Blue's videos have lower
| framerate than the ones in 2D. Does it take so long to render 3D
| so that you'll have to lower the FPS to speed up the process or
| is it just another tool?
| tnorthcutt wrote:
| Fans of Grant's work (3Blue1Brown) might also like his short
| lived podcast, Ben Ben and Blue: https://www.benbenandblue.com
|
| One of the Bens is Ben Eater, who has a fantastic YouTube channel
| that I enthusiastically recommend: https://youtube.com/c/BenEater
| snicker7 wrote:
| For Julia coders, there is Javis.jl
|
| https://www.youtube.com/watch?v=ckvsc6ukdOc
| nuclearnice1 wrote:
| Very cool
|
| At a glance, it seems tightly bound to making math animations,
| unsurprisingly.
|
| Are there more general open source animation tools? Or other
| narrow tools for other niches?
| cmrdsprklpny wrote:
| You might like Wick Editor: https://wickeditor.com
| 5faulker wrote:
| Nice name.
| bsenftner wrote:
| Does anyone have experience to compare this with MathBox?
| https://github.com/unconed/mathbox Mathbox is JavaScript, not
| Python, but presentation graphics are often web based, so I
| consider these two to be supplying solutions for similar needs.
| Zhyl wrote:
| I've only seen on the author's website [0], but the
| explainables there are some of the best I've seen. [1,2]
|
| [0] https://acko.net
|
| [1] https://acko.net/blog/how-to-fold-a-julia-fractal/
|
| [2] https://acko.net/blog/to-infinity-and-beyond/
| bsenftner wrote:
| I've used Mathbox quite a bit, it is flat out incredible, a
| jaw dropping artful simplicity to use. So I am wondering if
| this is worth even looking into...
| Gene_Parmesan wrote:
| I don't know anything about MathBox, but manim's niche is
| animation for videos.
| bsenftner wrote:
| Mathbox too, but interactive as well.
| baby wrote:
| Feedback on the landing page: it's an animation engine but I can
| find no examples.
| srott wrote:
| There is a link to "our online Jupyter environment."...
|
| https://mybinder.org/v2/gist/behackl/725d956ec80969226b7bf9b...
| Darylgolden wrote:
| Good point! I'll bring it up with the other devs.
| bradrn wrote:
| A Haskell equivalent: https://reanimate.github.io/. Haven't used
| it myself, but the examples are incredibly impressive.
| lordleft wrote:
| I've always marveled at Grant's videos -- very cool to see this
| skratlo wrote:
| Why does it follow this pattern, at least in the docs, where the
| user is supposed to subclass Scene and provide a construct
| method? How does inheritance help here? Wouldn't it be simpler if
| instead users can make Scene using their own abstractions and
| functions in whatever way they feel is appropriate?
| kzrdude wrote:
| That's how OOP (but not Python) is taught sometimes
| nuclearnice1 wrote:
| I assume the Scene class is called into from some other part of
| the engine. So, your code needs to at least enter via those
| functions and return the right value / have the required side
| effects.
|
| There are probably other methods defining the scene interface
| defined in the base class definition.
| [deleted]
| SamBam wrote:
| This is very nice. It looks well-designed for a moderately-
| technical teacher to create stuff with a lot of reasonable
| defaults and assumptions over configuration.
|
| Here's the gallery of example stuff you can do:
| https://docs.manim.community/en/stable/examples.html
| mcphage wrote:
| Why is the method to set the text on an object "get_text()" ?
| SamBam wrote:
| It seems slightly confusing, but I think the idea is that the
| brace is creating a new text object, which is returned and
| you can then add it to the scene. So it's not "get the
| current string" it's "give me a text object with this
| string." Could have been named `create_text()` perhaps.
| honksillet wrote:
| One notion that I have had is that the rocks star wall street
| trader might often be someone who has just been lucky 4 or 5
| times in a row. If you assume that had actual insight on one
| trade and got lucky the other times you can attribute their
| success to mostly luck pretty easily. If you have a large enough
| pool of traders, the talisman traders are probabilistically
| inevitable.
| msdrigg wrote:
| This is an extension of an animation library used by math
| YouTuber 3blue1brown [0]. He has an excellent channel that I
| would recommend anything from. One of my favorite videos of his
| is where he shows the thought process behind solving a level 6
| Putnam competition problem and makes it seem almost doable [1].
|
| [0] https://m.youtube.com/channel/UCYO_jab_esuFRV4b17AJtAw
|
| [1] https://m.youtube.com/watch?v=OkmNXy7er84
| sundarurfriend wrote:
| I've never been able to get into these animated videos of 3b1b,
| but the more recent videos with a more conversational tone
| (Lockdown math, the MIT Computational thinking course, the
| podcast) have made me a big fan of Grant.
| abetusk wrote:
| A community fork of 3Brown1Blue's [0] Manim [1] for creating the
| math animations and pictures used in their videos. From the
| manimcommunity's README:
|
| """ NOTE: This repository is maintained by the Manim Community
| and is not associated with Grant Sanderson or 3Blue1Brown in any
| way (although we are definitely indebted to him for providing his
| work to the world). If you would like to study how Grant makes
| his videos, head over to his repository (3b1b/manim). This fork
| is updated more frequently than his, and it's recommended to use
| this fork if you'd like to use Manim for your own projects. """
|
| See the gallery for it in action [2].
|
| [0] https://www.youtube.com/channel/UCYO_jab_esuFRV4b17AJtAw
|
| [1] https://github.com/3b1b/manim
|
| [2] https://docs.manim.community/en/stable/examples.html
| omgJustTest wrote:
| While this seems to be good intentions, the message is unclear
| and confusing.
|
| 3b1b's explaination in his readme is much clearer and Manim
| community should decouple itself from the 3B1B name /
| popularity.
|
| "Manim is an animation engine for explanatory math videos. It's
| used to create precise animations programmatically, as
| demonstrated in the videos of 3Blue1Brown." [1]
|
| "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." [2]
|
| [1] Manim Community Edition Readme [2] Manim 3B1B edition
| dmix wrote:
| Agreed, I immediately got the impression it was what 3b1b was
| using...
| AnotherGoodName wrote:
| To be fair the gist of it is that "this is what the 3b1b
| team are using except it is a bit better".
| xmprt wrote:
| Although the fact that the 3b1b team isn't using the
| community version makes me wonder why and whether the
| community version is actually better. In any case I'll
| take their word for it that it's more beginner friendly.
| Darylgolden wrote:
| Community version core dev here, the reason is slightly
| complicated:
|
| Back in 2019, there was no community edition, and most
| people based their own work off 3b1b's repository. Back
| then, Manim used a renderer called Cairo, which was
| painfully slow especially for 3D Scenes. So in late 2019,
| 3b1b started work on making Manim use OpenGL as its
| renderer instead, in a new branch called the "shaders"
| branch. In mid-2020, the community became frustrated at
| Grant's lack of interaction with them and slow response
| in merging PRs, so they decided to start their own fork.
| However, since the shaders branch was still extremely
| buggy and unfinished back then, they decided to build off
| the master branch instead.
|
| In early 2021, the OpenGL transition on 3b1b/manim was
| "complete" (the shaders branch became the master branch,
| and 3b1b/manim uses OpenGL as its renderer now). This is
| probably the main reason 3b1b still uses his own version.
|
| Since we decided to work on the master branch, we were
| (and still are) using Cairo as the default renderer.
| However, work quickly began after this to transition the
| community version to use OpenGL. We currently have an
| experimental OpenGL renderer, and it actually is nearly
| as complete as 3b1b/manim. However, since we had to worry
| about backwards compatibility, tests, documentation,
| Jupyter, etc., this transition takes a lot of work and is
| still ongoing. I expect that within 1 or 2 months
| however, that the community version will become "strictly
| better" than 3b1b's version, i.e. it can do everything
| the 3b1b version can with the OpenGL renderer (although
| it may still be considered experimental).
|
| The reason we recommend using the community version is
| because it is significantly less buggy, has much more
| comprehensive documentation, tests, Jupyter support, new
| features added by contributors and devs, plus if you
| happen to run into a bug, you're far more likely to have
| a contributor notice it and make a PR fixing it quickly.
| Yes our renderer is slower, but we're quickly preparing
| to transition to OpenGL as a default.
|
| If you don't believe us that the community edition is
| more recommended for beginners, 3b1b himself says it now:
| https://www.3blue1brown.com/contact#manim
|
| For more information, you can read this page: https://doc
| s.manim.community/en/stable/installation/versions...
| tjader wrote:
| I believe 3b1b uses his extensive knowledge of the system
| he developed to sometimes do hacky things that wouldn't
| be easy to support long-term. His repo may be better for
| someone who has a similar extensive knowledge, but won't
| be ideal for someone who is mostly interested in it as a
| tool and doesn't want to learn its innards.
| a9h74j wrote:
| IIRC older projects of 3b1b don't necessarily build with
| later, evolving versions of 3b1b Manim. There might be
| some mix of versioning questions mixed in with branding
| questions.
| sitkack wrote:
| Someone please correct me if I am wrong (always, but am extra
| asking for it), is that the main 3b1b/manim is really just for
| Grant and folks in making his videos, and while he did open
| source it, he isn't interested in running a big OSS project.
|
| To me this really shows the power of OSS, and that one can
| "take ownership" of their destiny through forking and that it
| doesn't need to be adversarial.
|
| In many ways, ideas are much more powerful than code. That code
| itself can be a thought terminating thing, by making ideas
| reified, it also instantly constructs an Overton Window or
| maybe a Chesteron's Fence, or maybe a Winchester House. A
| Knot's Berry Farm of technical debt built on soggy metaphors.
| kaimorid wrote:
| lmaoooooooo well said _clapping_
| davidscolgan wrote:
| Yes, I've heard him say in a few places in his videos that he
| gives his blessing to this fork and encourages its use over
| his own repo for that exact reason.
| sitkack wrote:
| The cool thing about this is that it shows you can open
| source stuff and have people use it, but you don't _have_
| maintain the project.
|
| At the same time, I hope it encourages folks to open source
| their code even if it isn't "ready for prime time" or what
| ever euphemism is for embarrassment.
| ngmc wrote:
| Shameless plug: I'm mentoring a student who is building a
| beginner-friendly version of manim on top of p5.js for his Google
| Summer of Code Project - check it out!
|
| https://two-ticks.github.io/p5.teach.js/
|
| https://discourse.processing.org/t/animating-maths-in-p5-js
| liorben-david wrote:
| Love 3b1b, glad someone made a fork of his software
| EMM_386 wrote:
| 3blue1brown has fantastic videos, I always wondered how they were
| created.
|
| The official Quickstart documents have animations showing how the
| transitions work:
|
| https://docs.manim.community/en/stable/tutorials/quickstart....
| nrjames wrote:
| While not Manim generated, I came across this video explaining
| Bezier curves yesterday and thought it was pretty awesome.
|
| https://www.youtube.com/watch?v=aVwxzDHniEw
| dmix wrote:
| I've noticed a bunch of Youtube channels have really upped
| their animation game and mastered how to structure/pace their
| videos. Especially the science oriented ones like Kurzgesagt
| [1] and Veritasium [2]. It's a really great movement, I'm happy
| to see it. 3blue1brown definitely played a role in this in the
| early days.
|
| It reminds me of the way websites evolved around 2005-2010 to
| start to take design seriously, not just on specialist web
| design sites but on major news sites and search engines, etc.
| Part of it was "Web 2.0" and then Bootstrap style CSS
| frameworks and the maturity of browsers as IE6 died off.
|
| 1. https://www.youtube.com/user/Kurzgesagt
|
| 2. https://www.youtube.com/channel/UCHnyfMqiRRG1u-2MsSQLbXA
| jameshart wrote:
| Grant from 3b1b is actually explicitly encouraging people to
| try to make more mathematical education videos this summer
| [1] - and Freya Holmer cites that as being what encouraged
| her to expand from little gif explanations into a full-length
| exposition video for that piece on Bezier curves, so this is
| all connected!
|
| And in the spirit of sharing a bit of the 'how it's done' -
| obviously while Grant uses Manim, Freya uses Unity3D and her
| 'Shapes' library [2] to produce her visualizations - she also
| streams a lot of her dev work so if you want to follow along
| with how it's done, that's another avenue to look at.
|
| 1: https://www.3blue1brown.com/blog/some1
|
| 2: https://assetstore.unity.com/packages/tools/particles-
| effect...
| fumblebee wrote:
| I learned more from educational YouTube videos than I did
| during my (very expensive) lectures at university.
|
| I expect with the quality of videos that are now being
| churned out, that the "education gain coefficient" between
| old style lectures and brilliantly produced video content
| would only have increased further. (Of course this only works
| in practice if you're engaged with the video, which is also
| true for lectures).
| mdoms wrote:
| Fantastic animation, thanks for sharing.
| longas wrote:
| I believe that video has been animated in Unity, she is the
| creator of https://acegikmo.com/shapes/.
| BeeOnRope wrote:
| This looks awesome. I've been looking for something like this,
| not for math but for animations showing the steps of an algorithm
| (thing something like a matrix transpose, showing each step by
| moving the cells as they are moved by the algorithm). Still it
| seems like a good match since math and this type of algorithm
| animation seem pretty close.
|
| The main downside to be is the lack of SVG output: I'd have to
| embed videos whereas I prefer SVG if possible.
|
| Any other contender out there with vector output?
| javajosh wrote:
| Well I've been on a real Geometric Algebra (aka Clifford
| Algebra) kick lately, and ran across ganja.js [1]. It's a
| single no deps file that is...impressive. 120k uncompressed,
| and with it you can construct any degree algebra (including the
| more esoteric hyperbolic/parabolic ones), render to canvas, svg
| or webgl(!). It also includes a clever little DSL parser and
| interpreter (it overloads the scientific notation to name basis
| vectors!) that lets you construct more complex things from
| simple things using various kinds of products.
|
| The author, Steven De Keninck, is quite impressive as well,
| having got his start in the demoscene some time ago. He has a
| good video from SIGGRAPH 2019 [2] that explains why this
| algebra is better than [matrices, tensors, vectors, complex
| numbers]. Of particular interest (to me anyway) is the 2D
| projective geometry.
|
| I don't want to oversell it, but ganja is _fucking amazing_ and
| there is a great deal I want to do with it. For one, I 'd like
| to recapitulate my physics degree with it.
|
| [1] https://github.com/enkimute/ganja.js
|
| [2] https://www.youtube.com/watch?v=tX4H_ctggYo
| lifeisstillgood wrote:
| I look at this (and most animated video) and think I _ought_ to
| be able to use this in my boring grey corporate life - but maths
| at management levels rarely peeks above a std dev. I wonder how
| to raise the game?
| bee_rider wrote:
| Synergy is just the management way of saying covariance, right?
| Surely you can introduce some more advanced statistics
| concepts.
| lifeisstillgood wrote:
| In most businesses having reliable up to date raw data is the
| base level challenge. Analysis after this is like climbing a
| mountain and then just sticking a flag in it is all the
| effort anyone has left!
___________________________________________________________________
(page generated 2021-08-21 23:02 UTC)