Manim Tutorial Series E05: Interactivity | Mathematical Animations WITH EASE

  Рет қаралды 24,095

Benjamin Hackl

Benjamin Hackl

Күн бұрын

Manim is a free and open-source, community-maintained Python library for creating (mathematical) animations originally started by Grant "3blue1brown" Sanderson. This tutorial series is a guided tour through Manim's features.
This episode covers a very particular feature: keyboard and mouse interactivity with the OpenGL renderer - enjoy!
#manim #tutorial #animation #python #programming #math #3blue1brown
Links to resources
- Jupyter worksheet (copy code to run locally, interactivity does not work online): mybinder.org/v2/gh/behackl/ma...
- OpenGL user guide by aquabeam: www.aquabeam.me/manim/opengl_...
- Issue #2669: github.com/ManimCommunity/man...
- pyglet documentation: pyglet.readthedocs.io/en/late...
- pyglet key constants: pyglet.readthedocs.io/en/late...
- Interactive Scene methods source code: github.com/ManimCommunity/man...
- GitHub repo with series materials: github.com/behackl/manim-with...
- Manim: www.manim.community
- Discord: manim.community/discord
More about me
- Homepage: benjamin-hackl.at
- Twitch: / behackl
- Twitter: / behackl
- Discord: benjamin-hackl.at/discord
Attributions
- Audio mix & master: Jesús Rascón (@jesi_rgb)
- Presentation slides via revealjs.com
Music
- Album: Ayla by Bhxa | Provided by Lofi Records | lofigirl.com/blogs/releases/ayla
- Album: Sea Forest by Ambulo | Provided by Lofi Records | lofigirl.com/blogs/releases/s...
- Album: My Memoir by Elijah Lee | Provided by Lofi Records | lofigirl.com/blogs/releases/m...
---
Video contents:
0:00 Introduction and Disclaimers
1:50 The OpenGL Renderer and You
4:43 Example: OpenGL demo
13:47 Example: Textured Surface
15:18 Live Render Preview
21:19 Default Interactions
24:16 Custom Interactions
28:06 Example: Toy interaction example
33:08 Example: Newton iteration
44:58 Closing remarks, Outro

Пікірлер: 63
@BngPhysics
@BngPhysics 7 күн бұрын
Very good explanation and an amazing content creation ... best of luck
@sc0820
@sc0820 Жыл бұрын
The whole series is amazing. I think your channel deserves much more subscription.
@KivySchool
@KivySchool 2 жыл бұрын
AMAZING! Thanks for this, this is simply AWESOME! Thank you very much my brother, a lot of love from Brazil
2 жыл бұрын
Thank you so much to you, for those great videos and your work on manimCE!
@curiouswalk
@curiouswalk 2 жыл бұрын
A great addition to the tutorial series
@MathVisualProofs
@MathVisualProofs 2 жыл бұрын
So cool. Thanks for all your work.
@lebronx9516
@lebronx9516 2 жыл бұрын
Awesome job! You deserve way more subscribers, bro!! Keep up the great work!
@behackl
@behackl 2 жыл бұрын
Thank you for the kind words! Manim tutorials are still pretty niche content, but we'll see how things develop. :-)
@thecommexokid
@thecommexokid 2 ай бұрын
One very simple keyboard interaction that I have been finding extremely useful in my own work is one to print out the current Euler angles of the camera. That way once I've found a camera angle I like using the existing mouse interactions, I can quickly output what the angles are and paste them into my scene. Here's my implementation. Press 'a' while in the interactive embed window and you get a printout to the console window like "(theta=22*DEGREES, phi=-84*DEGREES, gamma=0*DEGREES)". def on_key_press(self, symbol, modifiers): from pyglet.window import key as pyglet_key if symbol == pyglet_key.A: (theta, phi, gamma) = (f"{angle/DEGREES:.0f}*DEGREES" for angle in self.camera.euler_angles) print (f"({theta=!s}, {phi=!s}, {gamma=!s})") super().on_key_press(symbol, modifiers)
@PritishMishra
@PritishMishra 2 жыл бұрын
This was a great video!!!
@m67esteban
@m67esteban Жыл бұрын
Thanks! This tutorial is very useful!
@behackl
@behackl Жыл бұрын
Glad to hear and happy you liked it! Thank you!
@thomassouza5853
@thomassouza5853 2 жыл бұрын
New Manim video, Awesome
@erebology
@erebology 2 жыл бұрын
Excellent!
@hikmatahmedov
@hikmatahmedov 2 жыл бұрын
Hi, please create one video about transforming Latex expressions. Let's say you want to create a video that simplifies expression step by step. How can we do it beatifully and what options do we have. Thanks a lot in advance.
@behackl
@behackl 2 жыл бұрын
Thank you for the suggestion!
@ndrcrypto
@ndrcrypto 2 жыл бұрын
Thanks a lot MSensei
@blvrglu
@blvrglu 2 жыл бұрын
Awesome
@josemichellpr
@josemichellpr 2 жыл бұрын
Thanks 👍
@NdrXbrain
@NdrXbrain 2 жыл бұрын
thanks a lot
@EdvanPontes
@EdvanPontes 2 жыл бұрын
For the sake of humanity, we need more videos from you.
@behackl
@behackl 2 жыл бұрын
Soon! There are a few other things right now that require my attention more than creating videos, unfortunately. :-)
@PRAMODKUMAR-rk6wh
@PRAMODKUMAR-rk6wh 2 жыл бұрын
Thanks for such amazing content. Kindly add more on camera, multi_camera , moving_camera , 3d_camera and mapping camera.
@behackl
@behackl 2 жыл бұрын
interesting ideas, thank you!
@adidevbhattacharya9220
@adidevbhattacharya9220 7 ай бұрын
Benjamin, thank you so much for these tutorials, made reading the documentation easier. Btw can we have this interactivity using openGL in web, maybe if someone wants to have a React app, in that case?
@xs6819
@xs6819 Жыл бұрын
Can't wait till this hits Udemy
@mounibmekhilef8536
@mounibmekhilef8536 2 жыл бұрын
Hi benjamin, yet another great piece ! I wonder whether we can find in openGL features to display/plot implicit surfaces ( f(x,y,z)=0 ). The reason I'm asking is because transforming implicit to parametric is not (to my knowledge) an easy task. May be my question is naive as my knowledge about OpenGL goes back to its origin when using mainframes to make some little computations like displaying a polynomial.
@behackl
@behackl 2 жыл бұрын
Thanks! Good question -- I don't think that there is a good way; certainly nothing that is already implemented. The approach that is used for plotting two-dimensional equations scales badly (if at all) for three-dimensional ones.
@lam_xyz
@lam_xyz Жыл бұрын
Is there a possibility to implement something like a slider control to change parameters and have some graphics changing interactively (kind of an „geogebra emulation“ but in combination with programmatical animation which is not possible in ggb)?
@Programmer_Cookbook
@Programmer_Cookbook 11 ай бұрын
Have you tried to jointly use Manim and some GUI library like Tkinter or PyQT?
@sapandeepsandhu4410
@sapandeepsandhu4410 27 күн бұрын
@@Programmer_Cookbook no but now I will
@matthewjames7513
@matthewjames7513 2 жыл бұрын
AMAZING!!! So glad you're doing this stuff, thank you! May I ask what file format the output tutorial is? I guess it can't be mp4. I noticed at 45:19 that you talked about how this can only be used locally at this point. In principle, do you think it could be possible in the future to embed this type of interactive video in a current LMS like Canvis/blackboard/moodle? Thanks :) :) :)
@behackl
@behackl 2 жыл бұрын
Thank you! :-) Output: there *is* no output file; the application is just running in the render preview window; as mentioned in the video: if you want to share this, you'll have to record your screen. As for embedding: I'd say it is a long-term goal to get this sort of functionality up and running in some sort of shareable format, but there is a lot of work to be done to actually get there.
@matthewjames7513
@matthewjames7513 Жыл бұрын
@@behackl Hi Ben, do you know where I can keep updated on the latest status of interactive videos using MANIM? I'm a University teacher and I want to hire a few students to create interactive videos with me, but I have yet to decide the best platform to do it it in. I'm torn between MANIM and FigureOne (JS library)
@behackl
@behackl Жыл бұрын
​@@matthewjames7513 Hey Matthew! There hasn't been much change, feature-wise, since I've recorded this video. (I don't find as much time to work on it as I'd like to have, unfortunately.) If you want others to interact with your videos too (in contrast to only you interacting during a lecture), I'd definitely recommend some JS Library like FigureOne, Liqvid, or Motion Canvas. Good luck! 🙂
@theFire-nx6pd
@theFire-nx6pd 2 жыл бұрын
More please 🙏
@behackl
@behackl 2 жыл бұрын
More episodes soon! What would you like to learn more about?
@user-nr2bf2jt5p
@user-nr2bf2jt5p 7 ай бұрын
where could i find the documations of opengl methods, for example i want to learn more about opengltexturesurface method?
@CalcWithDec
@CalcWithDec Жыл бұрын
This is great!! Thanks for the awesome introduction. Is there any update yet about sharing these interactions?
@behackl
@behackl Жыл бұрын
Nothing new to report, unfortunately.
@CalcWithDec
@CalcWithDec Жыл бұрын
@@behackl ok, thanks for the response!
@claire7848
@claire7848 Жыл бұрын
Thank you for the wonderful video! When I try the same codes in the OpenGL demo, I get an error saying that 'OpenGLSurface' object has no attribute 'shader_wrapper'. Do you think I am missing a package?
@behackl
@behackl Жыл бұрын
Hey! I think you also asked via Discord, just for the sake of answering the question here too: this was a bug which we have just fixed; a new release (Manim v0.17.2) has been published a few minutes ago. :-)
@arktessellator_10
@arktessellator_10 2 жыл бұрын
hey man i have been trying to work through some simple animation of scaling a vector by using manim, however i think scale method scales any mobject from its centre, but in case of scaling vector it should scale having its origin fixed, how do i animate such scaling of vector?
@behackl
@behackl 2 жыл бұрын
Hey! YT comments are not great for discussing a problem like this, take a look at this page in our documentation to see different ways of getting help: docs.manim.community/en/latest/faq/help.html#faq-getting-help
@gflaesch
@gflaesch Жыл бұрын
Hi Benjamin, thank you for that awesome intro to the interactive mode! Is it possible to extract the current camera angles, once I have set it up the way I like?
@behackl
@behackl Жыл бұрын
Thanks for the kind words! I think you might have already asked the same question in our Discord, but for the sake of completeness I'll answer here too: Inside of the construct method, you can use self.renderer.camera.euler_angles to get a list consisting of the current values of [theta, phi, gamma].
@gflaesch
@gflaesch Жыл бұрын
Yes, I asked it there as well, not realizing that it would be kind of ending in the same pool of people ;) Thank you very much for the answer!
@Ghost-tm5gw
@Ghost-tm5gw 2 жыл бұрын
Hey guys, i get a error (No module named IPython) or smthn like it when i used interactive_embed
@behackl
@behackl 2 жыл бұрын
You have to install IPython, something like "pip install IPython" or "python -m pip install IPython" should do the trick. :-) If you are getting an error mentioning something about SQL, run the install command again, but with IPython==8.0.1 instead!
@StarFury2
@StarFury2 Жыл бұрын
Had the same problem. As author suggested using: pip install ipython==8.0.1 solved missing ipython and sql problem.
@matthewjames7513
@matthewjames7513 2 жыл бұрын
Hey Ben! at 11:10 you type into your command window "manim -qm -p --renderer=opengl e05.py Open" I assume the end of that line is just OpenGL, right? I plan to write this instead of the normal normal "python -m manim filename.py"
@matthewjames7513
@matthewjames7513 2 жыл бұрын
ah I realized that you just wrote the class name at the end. But when I run it, it says I cannot find the path, which is weird because i've previously set the path to my folder "cd ": "manim : The term 'manim' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again."
@behackl
@behackl 2 жыл бұрын
Hey! Apologies, I've been travelling the past week -- it sounds like as if manim is not on your PATH; perhaps you have fixed it already -- but if not, the easiest fix is to google for "add python executable module to PATH" for your operating system and you should find helpful answers.
@shivangt.g.2684
@shivangt.g.2684 2 жыл бұрын
Can to please tell me how to animate the zeta function transformation on the complex plane in manim
@behackl
@behackl 2 жыл бұрын
This is a very particular question; from what you are asking I can't quite tell what exactly you would like to see. I don't think this here is a good place to keep discussing; I'd recommend asking in our Discord (manim.community/discord), or open a Discussion in our GitHub repository (github.com/ManimCommunity/manim/discussions/new).
@shivangt.g.2684
@shivangt.g.2684 2 жыл бұрын
@@behackl thanks
@brahimcheikh3852
@brahimcheikh3852 Жыл бұрын
when i tray that code they told me AttributeError: 'Camera' object has no attribute 'animate'
@behackl
@behackl Жыл бұрын
Are you sure you are running manim with the --renderer=opengl flag? Otherwise check this link for suggestions how to get help more efficiently than via YT comments: docs.manim.community/en/stable/faq/help.html
@rauchnog3288
@rauchnog3288 2 жыл бұрын
hi benjamin, wann rechnest du den nächsten matura termin
@behackl
@behackl 2 жыл бұрын
Hallo! Ich denke, die letzten paar Termine + Ersatztermine habe ich ziemlich abgedeckt; der nächste ist also vermutlich der am 3.5. stattfindende Haupttermin. :-)
@rauchnog3288
@rauchnog3288 2 жыл бұрын
@@behackl danke für die rasche antwort! liebe deine videos obwohl ich noch weit von der matura weg bin! LG
Manim Tutorial: A "very mathematical" Updater Animation example
36:41
Summer shower by Secret Vlog
00:17
Secret Vlog
Рет қаралды 12 МЛН
Inside Out Babies (Inside Out Animation)
00:21
FASH
Рет қаралды 15 МЛН
КАК ДУМАЕТЕ КТО ВЫЙГРАЕТ😂
00:29
МЯТНАЯ ФАНТА
Рет қаралды 10 МЛН
VSCode's Python Interactive mode is AMAZING!
6:58
Jack of Some
Рет қаралды 347 М.
Advice for using Manim | Grant Sanderson and Lex Fridman
4:30
Is it worth learning Manim?
8:06
Theorem of Beethoven
Рет қаралды 50 М.
Это - iPhone 16 и вот что надо знать...
17:20
Overtake lab
Рет қаралды 139 М.
iPhone 16 с инновационным аккумулятором
0:45
ÉЖИ АКСЁНОВ
Рет қаралды 10 МЛН
8 Товаров с Алиэкспресс, о которых ты мог и не знать!
49:47
РасПаковка ДваПаковка
Рет қаралды 167 М.