Skip to content

How can I make an animation? #10

Answered by rafael-fuente
Nanran asked this question in Q&A
Discussion options

You must be logged in to vote

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

from sightpy import *


# First, we set up the scene to animate like in example1.py:

# define materials to use
gold_metal = Glossy(diff_color = rgb(1., .572, .184), n = vec3(0.15+3.58j, 0.4+2.37j, 1.54+1.91j), roughness = 0.0, spec_coeff = 0.2, diff_coeff= 0.8) # n = index of refraction
bluish_metal…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@AlkisPis
Comment options

@AlkisPis
Comment options

Answer selected by rafael-fuente
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #4 on June 06, 2021 17:34.