[HN Gopher] Manim - an animation engine for explanatory math videos
       ___________________________________________________________________
        
       Manim - an animation engine for explanatory math videos
        
       Author : vermilingua
       Score  : 835 points
       Date   : 2021-03-18 00:34 UTC (22 hours ago)
        
 (HTM) web link (3b1b.github.io)
 (TXT) w3m dump (3b1b.github.io)
        
       | Dentrax wrote:
       | I guess this was used by Sentdex [0] in the Neural Networks from
       | Scratch series.
       | 
       | [0] https://youtu.be/gmjzbpSVY1A?t=52
        
         | _up wrote:
         | Looks to me more like they used a compositor like AE or
         | Blackmagic Fusion/Resolve.
        
       | pixelbath wrote:
       | There's also MathBox, which seems to take a more D3-style
       | approach to creating diagrams: https://github.com/unconed/mathbox
       | 
       | Examples in a presentation:
       | http://acko.net/files/gltalks/pixelfactory/online.html#35
       | 
       | Some documentation:
       | https://github.com/unconed/mathbox/blob/master/docs/intro.md
        
       | assumenda wrote:
       | Nice update
        
         | [deleted]
        
       | rsj_hn wrote:
       | That this is not called Manin is a lost opportunity.
       | https://en.wikipedia.org/wiki/Yuri_Manin
        
         | fortran77 wrote:
         | I thought of this: https://en.wikipedia.org/wiki/Mobile_Guards
         | 
         | mnym
        
           | rsj_hn wrote:
           | mnvm or mnym ?
           | 
           | In any case, if they were fighting mathematicians, it would
           | be pretty awesome.
        
       | john4532452 wrote:
       | It reminds me of the quote from SICP whenever i a domain specific
       | languages frameworks etc
       | 
       | "Establishing new languages is a powerful strategy for control-
       | ling complexity in engineering design; we can often enhance
       | ourability to deal with a complex problem by adopting a new lan-
       | guage that enables us to describe (and hence to think about)the
       | problem in a different way, using primitives, means of com-
       | bination, and means of abstraction that are particularly
       | wellsuited to the problem at hand." -- Harold Abelson
        
       | druidmaster wrote:
       | also: https://leetanim.com
        
         | shurane wrote:
         | Is this a previewer for manim? Really reminds me of
         | https://bl.ocks.org/, https://observablehq.com/,
         | https://asciinema.org/, and https://nbviewer.jupyter.org/.
         | 
         | Really enjoy these kinds of tools. Though I wish you didn't
         | need an account to preview or upload content to manim.
        
           | maxkrieger wrote:
           | There's also https://eulertour.com
        
       | nishparadox wrote:
       | Grant has been one of the inspirations since my early BE days
       | (that was years ago). I got so much inspired from manim that I
       | tried to make my own animation tool, panim [0] where I
       | implemented mathematical concepts I understood. Nowadays,
       | whenever I am in a rut, I jump back to panim and try to jot down
       | my ideas into code.
       | 
       | (Say, "panim" name might be a gimmick?)
       | 
       | --- [0] - https://github.com/NISH1001/panim
        
       | bunje wrote:
       | As a teacher, I'd like to use this in presentation slides, i.e.
       | pause the output at specific times and continue only after a
       | button is pressed. Does anyone know if there exists a tool, e.g.,
       | to automatically pause MP4 playback at specific times?
        
         | gnicholas wrote:
         | If you want to stop at specified times, you could just split
         | the video across several slides.
         | 
         | Or you could pause the video manually; in Keynote, press K to
         | play/pause.
        
         | [deleted]
        
         | enriquto wrote:
         | if you are comfortable with LaTeX, you can use the animate
         | package on beamer slides. It does just that, and allows both
         | playing the animation or running it frame by frame (fwd and
         | back).
        
         | _hl_ wrote:
         | manim works by generating a "partial movie file" for each
         | animation, i.e. a single mp4 file for each scene.wait() call
         | and so on. The final output just stitches these together.
         | 
         | I did exactly what you want using a small reveal.js plugin that
         | parses the list of partial files generated by manim and inserts
         | the corresponding video files into the presentation in thst
         | order, it worked quite well. Let me know if you're interested
         | and I'll throw it up on a GitHub gist.
        
         | qiqitori wrote:
         | Don't know how user friendly you'd like this to be, but VLC has
         | a text-based remote control interface:
         | https://wiki.videolan.org/documentation:modules/rc/
         | 
         | This allows you to e.g. get the current time (get_time) and
         | pause playback (pause). So you just have to write a small
         | script that issues the commands the way you want and you'll be
         | good.
        
         | mrdonbrown wrote:
         | I built exactly this in my Manim-based library, code-video-
         | generator [1] (via the code-video-generator command and the
         | --slides flag). It basically turns any Manim scene.wait() call
         | into a pause that I can then advance with a clicker. I used it
         | for this video [2], where I was recording in front of a green
         | screen, but wanted the exact control when the animation
         | continued. code-video-generator played the video fullscreen,
         | which I then captured via obs [3] and used the obs display as a
         | monitor to see if I was pointing at the right spot. Was a bit
         | tricky to get all set up but worked pretty well.
         | 
         | [1] https://github.com/sleuth-io/code-video-generator [2]
         | https://youtu.be/e21hJnB9J5k?t=44 [3] https://obsproject.com/
        
       | sidcool wrote:
       | This is amazing. I can totally see using this to make
       | presentations.
        
       | dang wrote:
       | If curious, past threads:
       | 
       |  _Show HN: I made a parser visualizer using manim_ -
       | https://news.ycombinator.com/item?id=26382729 - March 2021 (15
       | comments)
       | 
       |  _A Manim Code Template_ -
       | https://news.ycombinator.com/item?id=24985609 - Nov 2020 (1
       | comment)
       | 
       |  _Manim: Animation engine for explanatory math videos_ -
       | https://news.ycombinator.com/item?id=24926947 - Oct 2020 (19
       | comments)
       | 
       |  _Manim - 3Blue1Brown 's animation engine for explanatory math
       | videos_ - https://news.ycombinator.com/item?id=19716019 - April
       | 2019 (80 comments)
       | 
       | This one is a dupe because Oct 2020 was less than a year ago
       | (https://news.ycombinator.com/newsfaq.html) but I think we can
       | leave it up.
        
       | sidpatil wrote:
       | There is also the Manim Community Edition:
       | https://github.com/ManimCommunity/manim/
       | 
       | According to the original Manim's readme, it's recommended to use
       | the Community Edition, since it's updated more often.
        
       | melling wrote:
       | Grant helped out with this MIT course last fall:
       | 
       | https://computationalthinking.mit.edu/Fall20/lecture26/
       | 
       | I believe he was going to do some of the visualizations
        
         | sitkack wrote:
         | This video linked from the course is excellent,
         | https://www.youtube.com/watch?v=g8RkArhtCc4
        
           | tptacek wrote:
           | This video is bananas awesome. I'd start writing Julia right
           | now if it wasn't for the 1-indexing.
        
             | jpfr wrote:
             | Tough luck. Using 0-indexing would have lost Matlab users
             | to the Julia community. So they consciously decided to
             | rather lose you. :-)
             | 
             | I got used to switching between 0/1-indexing. The only
             | place it actually hurts is when using modulo to remain
             | within some range. And this is needed much much less in
             | Julia than in C and C-like.
        
               | contravariant wrote:
               | I'll accept using modulo as an argument when CPU
               | manufacturers finally do the sane thing and make sure
               | that x mod n is always a non-negative integer.
        
               | tptacek wrote:
               | It's funny, from the votes on my comment it seems like I
               | came across as seriously criticizing Julia (a language I
               | admire) rather than just being hyped about that video
               | (which is excellent).
        
               | vcxy wrote:
               | Julia has the function mod1 which is just mod + 1, just
               | in case that's ever useful for you :)
        
               | conistonwater wrote:
               | Can't you just use mod(x, 1:n)? Or mod(i,
               | eachindex(vals))?
        
             | [deleted]
        
             | polytely wrote:
             | Honest question, is it that hard to just adjust to
             | 1-indexing? I switch languages all the time and they all
             | have their different quirks and I find it really hard to
             | understand why people cannot deal with for example
             | 1-indexing. From the outside looking in it seems like one
             | of the easier things to adjust to?
        
               | nimih wrote:
               | My personal experience using Lua/love2d for some
               | (amateur/hobbyist) game programming is that the
               | adjustment really wasn't too difficult at all -- I've run
               | into an off-by-one error or two, but not at any greater
               | (or reduced) frequency compared to 0-indexed languages
               | AFAICT. Obviously, some of the sibling comments here
               | disagree, so the only reasonable conclusion I can draw is
               | that it varies from person to person how much they care
               | and how much effort it takes to adjust.
               | 
               | At the end of the day, like all language design decisions
               | involving an arbitrary choice among reasonable options,
               | you get used to it once you use the language enough (and
               | also some folks will refuse to ever use the language
               | because of it for aesthetic reasons).
        
               | OvermindDL1 wrote:
               | I always go back to this: https://www.cs.utexas.edu/users
               | /EWD/transcriptions/EWD08xx/E...
        
               | thotsBgone wrote:
               | It's intuitive to me that the option "c) 2 <= i <= 12" is
               | the only acceptable answer, since it is the only range
               | you can tell immediately at a glance what numbers are
               | included: 2, ..., 12. There shouldn't be a 1 or a 13 in
               | the notation if there won't be a 1 or a 13 in the
               | sequence it's describing -- it's just bad design.
               | 
               | If you select the option "c) 2 <= i <= 12", then
               | Dijkstra's subsequent argument for zero-indexing becomes
               | an argument for one-indexing, because a sequence of
               | length N yields the range 1 <= i <= N when subscripting
               | with 1, but 0 <= i <= N-1 when starting at 0. The latter
               | is uglier than the former.
        
               | posterboy wrote:
               | It's my gut feeling that your preference yields an
               | equivalent amount of ugly N+1.
        
               | yesenadam wrote:
               | It is a pain, yes, after decades of 0-indexed languages!
               | I switched to mostly-Julia from mostly-C in the last
               | year, and the 1-indexing is the main irritating thing. I
               | have to learn different ways of doing things, which I
               | guess I haven't yet, so the parts in my programs dealing
               | with 1-indexing seem cumbersome and fiddly, every time.
               | 0-indexing just seems mathematically much simpler. And I
               | like things making things as simple as possible. Maybe as
               | I learn different habits, that impression will go away.
               | 
               | It's also about the only thing I really don't like about
               | Julia - so I can understand someone saying 1-indexing is
               | a deal-breaker.
        
               | vcxy wrote:
               | > Maybe as I learn different habits, that impression will
               | go away.
               | 
               | I'd bet this is true. It doesn't seem fiddly to me as a
               | mathematician. Thinking habits can be really hard to get
               | past though, so I also understand people not liking
               | 1-based. I just think the argument from math is wrong.
        
               | mcguire wrote:
               | Yes.
               | 
               | I've used many languages, and I don't have much problem
               | with any quirks or major differences (Haskell,
               | JavaScript, ...). The only language I've bounced off of
               | is Prolog, and I'm planning another attempt.
               | 
               | But I've done a lot of low level programming, and 0-based
               | arrays are a no-brainer to deal with. Switching to
               | 1-based arrays throws out all of my intuitions and makes
               | me have to recalculate everything, which is error-prone.
        
               | Asooka wrote:
               | Yes. It looks wrong and feels wrong. I can adjust to
               | indentation styles, programming styles, etc. but 1-based
               | indexing is an absolute deal-breaker for me. It's one of
               | the few things the programming community has settled on -
               | indexing starts at 0, as it is mathematically the most
               | natural start.
        
               | leephillips wrote:
               | The scientific programming community, starting with
               | Fortran, has, on the contrary, settled on 1, because it
               | is mathematically the most natural start.
        
               | sidpatil wrote:
               | > It's one of the few things the programming community
               | has settled on - indexing starts at 0, as it is
               | mathematically the most natural start.
               | 
               | When you're in the supermarket and you're counting how
               | many items are in your shopping cart, do you start from
               | 0?
        
               | mcguire wrote:
               | You start with an empty cart, right?
        
               | Jtsummers wrote:
               | It depends on what you think you're doing.
               | 
               | If you are _counting_ , 1-based makes a lot of sense. If
               | you're _indexing_ , they're equally valid approaches.
               | However, if you're indexing then you should be able to
               | use an arbitrary range and not be restricted to one or
               | the other (with a mapping function from your actual range
               | to the language's base).
        
               | dragonwriter wrote:
               | > When you're in the supermarket and you're counting how
               | many items are in your shopping cart, do you start from 0
               | 
               | Yes, because the cart starts empty. But, more to the
               | point, I don't call the thing I put into the cart that
               | causes it not to be empty the zeroth item.
        
               | cratermoon wrote:
               | Database auto-indexed columns have entered the chat.
        
               | bmitc wrote:
               | And yet, the set of _natural_ numbers in mathematics is
               | most often taken to start at 1. Mathematicians don't have
               | a problem with indexing.
        
               | mcguire wrote:
               | Is it? Most nat's are built from zero and succ(n) in my
               | experience.
        
               | vcxy wrote:
               | (I'm a mathematician)
               | 
               | Honestly, not that many people in math think about the
               | construction of the natural numbers frequently. Yeah, we
               | learn about it of course, but that's about it. Very often
               | the natural numbers do not include 0. Often they do. I've
               | seen $\mathbb Z_{\geq0}$ and $\mathbb Z_+$ used to avoid
               | having to worry about it.
               | 
               | Hell, different countries can't even agree on whether 0
               | is positive. In France, 0 is considered both positive and
               | negative. In USA, 0 is considered neither.
               | 
               | (quick edit: I realize my last paragraph makes the
               | $\mathbb Z_+$ option seem weird. I do math in the
               | States.)
        
               | mcguire wrote:
               | That's what Wolfram Mathworld suggests: specifying a
               | subset of the integers. :-)
        
             | Hasnep wrote:
             | Julia also supports arbitrary indexing [-1], you can even
             | start from a negative number!
             | 
             | [-1] https://docs.julialang.org/en/v1/devdocs/offset-
             | arrays/
        
               | mcguire wrote:
               | Don't you have issues with library calls that want
               | 1-based arrays?
        
               | adgjlsfhk1 wrote:
               | No. Multiple dispatch means that libraries should just be
               | able to handle it. If you ever run into problems, file a
               | bug report. It should get fixed pretty quickly.
        
         | beforeolives wrote:
         | The course is kind of all over the place. There isn't a lot of
         | focus in the content and the quality of the teaching is
         | inconsistent. Grant's videos were the best by far.
        
       | penguin_booze wrote:
       | For anyone looking for a Docker container, it's here:
       | https://hub.docker.com/r/manimcommunity/manim.
        
       | oroul wrote:
       | I always wondered how 3B1B makes the animations in his videos.
       | Super pleased to see it's available as a Python library. Can't
       | wait to play around with this!
        
       | kumartarun wrote:
       | Since the day I watched the Interstellar movie, I always thought
       | of understanding and making the black hole simulation. I guess I
       | could make it now.
        
         | mhh__ wrote:
         | The user "rantonels" (IIRC) on /r/physics has some posts about
         | general relativity based ray tracing of black holes
        
       | pncnmnp wrote:
       | I remember playing with Manim last year. I wrote a blog-post
       | regarding the same: https://pncnmnp.github.io/blogs/manim.html
       | 
       | Some of their older documentation (now less relevant) is
       | available on Internet Archive:
       | https://web.archive.org/web/20200122124703/https://manim-tb-...
        
       | otikik wrote:
       | This feels like something that should exist on
       | javascript/typescript, and produce results directly on a Canvas.
       | Having to use an intermediate video feels jarring on a website. I
       | guess people producing videos directly (Youtubers) will find it
       | more useful.
        
         | franga2000 wrote:
         | I don't see much use in that for non-interactive content.
         | Rendering something like that isn't cheap (computationally) and
         | doing it potentially millions of times for a popular piece of
         | content is just wasteful. A canvas element also wouldn't be any
         | less "jarring", since ultimately, it's still just a box of
         | pixels.
         | 
         | As for interactive content, you'd probably be better off using
         | something else that was created with a focus on realtime
         | performance and portability. You
        
       | snicker7 wrote:
       | Manim is the inspiration for a similar package in Julia, Javis.jl
       | [0].
       | 
       | 0: https://github.com/Wikunia/Javis.jl
        
         | bradrn wrote:
         | As well as the Haskell reanimate package:
         | https://github.com/reanimate/reanimate
        
           | vanderZwan wrote:
           | Anyone know of any JavaScript editions?
        
       | abaga129 wrote:
       | I always wondered how 3blue1brown created his videos! Thanks for
       | sharing
        
       | NL807 wrote:
       | I always wondered how 3blue1brown made his animation clips. They
       | are very good.
        
       | zappo2938 wrote:
       | The single most awesome visualization I've seen to date that uses
       | Manim and Grant has made some amazing stuff. This video removes
       | all mystery of how ReLU activation works. [0]
       | 
       | [0]https://www.youtube.com/watch?v=gmjzbpSVY1A
        
       | AimsFertility wrote:
       | BEST IVF CENTER IN INDIA - AIMS FERTILITY -2021
       | 
       | Aims Fertility is a Fertility and Reproductive healthcare
       | Hospital Chain. We assist you to get the best treatment possible
       | well within your budget and from the most experienced doctors in
       | its network and in various Clinics and Hospitals by helping you
       | with unbiased transparent information, and No hidden charges
       | across Fertility center and assist with Trust, Transparency,
       | Independence, Authority, and Patient Feedback. * Find Best IVF
       | Centre in india * Get Low-Cost Surrogacy Package in india * 100%
       | Guaranteed Success or money back plan in IVF only with Aims
       | Fertility * Get Free Consultation with Highly Experienced Doctor
       | with Aims Fertility
       | 
       | Contact us @ 9667619090 Email us @ support@aimsfertility.com
       | Visit us @ www.aimsfertility.com https://aimsfertility.com
        
         | yipbub wrote:
         | I'm here can counterspam this with tools they have on-hand.
         | Please?
        
       | jmartrican wrote:
       | Always wondered how 3blue1brown did his animations. I always find
       | them hypnotic and entertaining, even though the math is going way
       | over my head.
        
       | krmmalik wrote:
       | This is amazing. I'm looking for a low-code / no-code version of
       | something like this for my video essays. Right now I have to rely
       | on Adobe After effects which is a) costly and b) a little too
       | much kitchen sink.
       | 
       | Suggestions welcome.
        
       | billfruit wrote:
       | Can it do 3d animations?
        
         | xingyzt wrote:
         | Yup.
         | https://docs.manim.community/en/v0.4.0/examples.html#threedl...
        
       ___________________________________________________________________
       (page generated 2021-03-18 23:02 UTC)