115 points · by sytelus · 4y ago · 25 comments
Edit: sorry for being a joke but I saw "Python library math animation" and I immediately thought of 3B1B but I really had no idea this was it!
From the the READE:
"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."
https://github.com/two-ticks/p5.teach.js
https://medium.com/processing-foundation/p5-teach-teaching-m...
Making this comment less like a plug, and more like spam…
I for one am happy this got posted here. I used manim in the past, but its setup is really cumbersome (at least it was back then when I tried).
A JavaScript alternative is therefore much welcome. I will definitely have a look P5 Teach.
The syntax looks a lot easier than LaTeX for static images, but the animations also look really quick to generate with minimal boilerplate.
https://news.ycombinator.com/item?id=28245277 (community version)
https://news.ycombinator.com/item?id=19716019 (3Blue1Brown's version)
“Julia Animations and Visualizations”
In the first code snippet, I don't understand how Background(1:200, ground) is picked up. It looks to me like a statement disconnected from the others. I also don't understand how calling background("black") and sethue("white") in function ground affects anything. Are those some dynamic scope shenanigans? Or do those just modify some global variables? Generally, a lot of parts of the code don't seem connected in any way, I don't see how the data flows through code. Could someone familiar with Julia ELI5?
Co-creator of Javis.jl here! As adgjlsfhk1 said, there is an implicit global scope here! This comes from a historic artifact from Cairo (which is what Javis is using deep within its tooling stack) which utilizes this sort of approach.
Here is an ELI5 that may help about the flow of a Javis animation: imagine Javis as a magical artist sitting at a table. The artist is a bit peculiar as they can draw anything you want but will not draw anything until you finish telling them everything you want to see. When you create a `Video` object, the artist grabs an empty notebook and opens it up. If you create a `Background` object, basically you are telling the artist that you want the background of each page in the notebook to be, in this case, black for pages 1 - 200. As you keep telling the artist what you want, the artist listens to how you want it ordered, how objects should appear and animate, etc. Finally, when you tell the artist to `render` this animation, Javis springs to work and flips through all the different pages, drawing backgrounds, objects, etc. to match what you asked. Then, when Javis is all done, the artist gives you the notebook that when you open it up, it will magically flip through all the pages (i.e. at a given frame rate) showing you your requested animation.
I know this ELI5 doesn't really get into the internals, but at a high level, that is what is happening with the start of the `Video` object. Happy to give more details if desired. We are trying to move to a v1.0.0 release very soon and in v2.0.0 we want to experiment with different syntax - perhaps a more implicit syntax similar to manim and Processing. Out of curiosity, for you, do you find it necessary to know more about Javis's approach to use Javis or was this more of a question that you had? Reason why I ask is perhaps we could add a "How Javis Works" section to the documentation if that could help more folks.
Thanks!