How can I make an animation? #10
-
Hello!I am interested in your project name raytracer on github. I wonder how to generate "animation.gif", I can not find the source code. Could you please help me out?Thank you! I would be appreciate if you could send your all source code to me. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi! The method that can be used to make animations is create_animation. You can found it in animation.py This method takes as an argument the scene you want to animate, and a function named update_scene that tells how the scene is changed every frame. This method will create an image for each frame that later you can convert into a video using FFmpeg Here is a script that animates example1.py
This script creates a folder named "frames" that contains all frames of the animation. The video generated with this code is 5fps. For better quality use at least 30fps, although the rendering will take longer. |
Beta Was this translation helpful? Give feedback.
-
Thank you so much for your help! I have successfully gained the expected results. |
Beta Was this translation helpful? Give feedback.
Hi! The method that can be used to make animations is create_animation. You can found it in animation.py
This method takes as an argument the scene you want to animate, and a function named update_scene that tells how the scene is changed every frame. This method will create an image for each frame that later you can convert into a video using FFmpeg
Here is a script that animates example1.py