Skip to content

Instantly share code, notes, and snippets.

@nealrs
Created October 8, 2015 03:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nealrs/e5fb351c12a26c154b41 to your computer and use it in GitHub Desktop.
Save nealrs/e5fb351c12a26c154b41 to your computer and use it in GitHub Desktop.
create animation with Rayito & ImageMagick

Install rayito & imagemagick

Render the individual frames

rayito -workers=8 -file=p0.txt
rayito -workers=8 -file=p1.txt
rayito -workers=8 -file=p2.txt
rayito -workers=8 -file=p3.txt
rayito -workers=8 -file=p4.txt
rayito -workers=8 -file=p5.txt

Finally, use ImageMagick's convert utility to assemble the gif

convert -delay 10 -loop 0 *txt*.png loop.gif
# (optional, default 320 240) size = size of the final image
size 1024 768
nbounces 5
# (optional, default 1) oversampling=1 no oversampling
oversampling 2
# (optional, default 60) vision = size of the visual field
vision 60
# (optional, default all span) renderslice: start_rendering_line end_rendering_line
# renderslice note: if you use oversampling>1 it may give problems
#renderslice 10 40
cameraPos 5.0 5.0 5.0
cameraLook -1 -1 -1
cameraUp 0.5 0.0 1.0
# sphere: material_number x y z radius
sphere 0 0.0 1.1547 1.0 1.0
sphere 0 -1.0 -0.5773 1.0 1.0
sphere 0 1.0 -0.5773 1.0 1.0
sphere 0 0.0 0.0 2.6 1.0
# plane: material normal_x normal_y normal_z distancia:
plane 1 0.0 0.0 1.0 0.0
# light: x y z r g b point/ambient (rgb are in [0,1])
light -2.0 1.0 4.0 1.0 1.0 1.0 point
light 5 5 5 0.5 0.5 0.5 point
light 0.0 0.0 4.0 0.1 0.1 0.1 ambient
# material: r g b difuseCol specularCol specularD reflectionCol transmitCol IOR
material 1.0 0.4 0.0 1.0 0.5 3.0 0.1 0.0 0.0
material 0.8 0.8 0.9 1.0 0.0 4.0 0.1 0.0 0.0
# (optional, default 320 240) size = size of the final image
size 1024 768
nbounces 5
# (optional, default 1) oversampling=1 no oversampling
oversampling 2
# (optional, default 60) vision = size of the visual field
vision 60
# (optional, default all span) renderslice: start_rendering_line end_rendering_line
# renderslice note: if you use oversampling>1 it may give problems
#renderslice 10 40
cameraPos 5.0 5.0 5.0
cameraLook -1 -1 -1
cameraUp 0.5 0.0 1.0
# sphere: material_number x y z radius
sphere 0 0.0 1.1547 1.0 1.0
sphere 0 -1.0 -0.5773 1.0 1.0
sphere 0 1.0 -0.5773 1.0 1.0
sphere 0 0.0 0.0 2.6 1.0
# plane: material normal_x normal_y normal_z distancia:
plane 1 0.0 0.0 1.0 0.0
# light: x y z r g b point/ambient (rgb are in [0,1])
light -2.5 1.0 4.0 1.0 1.0 1.0 point
light 5 5 5 0.5 0.5 0.5 point
light 0.0 0.0 4.0 0.1 0.1 0.1 ambient
# material: r g b difuseCol specularCol specularD reflectionCol transmitCol IOR
material 1.0 0.4 0.0 1.0 0.5 3.0 0.1 0.0 0.0
material 0.8 0.8 0.9 1.0 0.0 4.0 0.1 0.0 0.0
# (optional, default 320 240) size = size of the final image
size 1024 768
nbounces 5
# (optional, default 1) oversampling=1 no oversampling
oversampling 2
# (optional, default 60) vision = size of the visual field
vision 60
# (optional, default all span) renderslice: start_rendering_line end_rendering_line
# renderslice note: if you use oversampling>1 it may give problems
#renderslice 10 40
cameraPos 5.0 5.0 5.0
cameraLook -1 -1 -1
cameraUp 0.5 0.0 1.0
# sphere: material_number x y z radius
sphere 0 0.0 1.1547 1.0 1.0
sphere 0 -1.0 -0.5773 1.0 1.0
sphere 0 1.0 -0.5773 1.0 1.0
sphere 0 0.0 0.0 2.6 1.0
# plane: material normal_x normal_y normal_z distancia:
plane 1 0.0 0.0 1.0 0.0
# light: x y z r g b point/ambient (rgb are in [0,1])
light -3.0 1.0 4.0 1.0 1.0 1.0 point
light 5 5 5 0.5 0.5 0.5 point
light 0.0 0.0 4.0 0.1 0.1 0.1 ambient
# material: r g b difuseCol specularCol specularD reflectionCol transmitCol IOR
material 1.0 0.4 0.0 1.0 0.5 3.0 0.1 0.0 0.0
material 0.8 0.8 0.9 1.0 0.0 4.0 0.1 0.0 0.0
# (optional, default 320 240) size = size of the final image
size 1024 768
nbounces 5
# (optional, default 1) oversampling=1 no oversampling
oversampling 2
# (optional, default 60) vision = size of the visual field
vision 60
# (optional, default all span) renderslice: start_rendering_line end_rendering_line
# renderslice note: if you use oversampling>1 it may give problems
#renderslice 10 40
cameraPos 5.0 5.0 5.0
cameraLook -1 -1 -1
cameraUp 0.5 0.0 1.0
# sphere: material_number x y z radius
sphere 0 0.0 1.1547 1.0 1.0
sphere 0 -1.0 -0.5773 1.0 1.0
sphere 0 1.0 -0.5773 1.0 1.0
sphere 0 0.0 0.0 2.6 1.0
# plane: material normal_x normal_y normal_z distancia:
plane 1 0.0 0.0 1.0 0.0
# light: x y z r g b point/ambient (rgb are in [0,1])
light -3.5 2.0 4.0 1.0 1.0 1.0 point
light 5 5 5 0.5 0.5 0.5 point
light 0.0 0.0 4.0 0.1 0.1 0.1 ambient
# material: r g b difuseCol specularCol specularD reflectionCol transmitCol IOR
material 1.0 0.4 0.0 1.0 0.5 3.0 0.1 0.0 0.0
material 0.8 0.8 0.9 1.0 0.0 4.0 0.1 0.0 0.0
# (optional, default 320 240) size = size of the final image
size 1024 768
nbounces 5
# (optional, default 1) oversampling=1 no oversampling
oversampling 2
# (optional, default 60) vision = size of the visual field
vision 60
# (optional, default all span) renderslice: start_rendering_line end_rendering_line
# renderslice note: if you use oversampling>1 it may give problems
#renderslice 10 40
cameraPos 5.0 5.0 5.0
cameraLook -1 -1 -1
cameraUp 0.5 0.0 1.0
# sphere: material_number x y z radius
sphere 0 0.0 1.1547 1.0 1.0
sphere 0 -1.0 -0.5773 1.0 1.0
sphere 0 1.0 -0.5773 1.0 1.0
sphere 0 0.0 0.0 2.6 1.0
# plane: material normal_x normal_y normal_z distancia:
plane 1 0.0 0.0 1.0 0.0
# light: x y z r g b point/ambient (rgb are in [0,1])
light -3.5 2.0 5.0 1.0 1.0 1.0 point
light 5 5 5 0.5 0.5 0.5 point
light 0.0 0.0 4.0 0.1 0.1 0.1 ambient
# material: r g b difuseCol specularCol specularD reflectionCol transmitCol IOR
material 1.0 0.4 0.0 1.0 0.5 3.0 0.1 0.0 0.0
material 0.8 0.8 0.9 1.0 0.0 4.0 0.1 0.0 0.0
# (optional, default 320 240) size = size of the final image
size 1024 768
nbounces 5
# (optional, default 1) oversampling=1 no oversampling
oversampling 2
# (optional, default 60) vision = size of the visual field
vision 60
# (optional, default all span) renderslice: start_rendering_line end_rendering_line
# renderslice note: if you use oversampling>1 it may give problems
#renderslice 10 40
cameraPos 5.0 5.0 5.0
cameraLook -1 -1 -1
cameraUp 0.5 0.0 1.0
# sphere: material_number x y z radius
sphere 0 0.0 1.1547 1.0 1.0
sphere 0 -1.0 -0.5773 1.0 1.0
sphere 0 1.0 -0.5773 1.0 1.0
sphere 0 0.0 0.0 2.6 1.0
# plane: material normal_x normal_y normal_z distancia:
plane 1 0.0 0.0 1.0 0.0
# light: x y z r g b point/ambient (rgb are in [0,1])
light -5.0 2.5 5.0 1.0 1.0 1.0 point
light 5 5 5 0.5 0.5 0.5 point
light 0.0 0.0 4.0 0.1 0.1 0.1 ambient
# material: r g b difuseCol specularCol specularD reflectionCol transmitCol IOR
material 1.0 0.4 0.0 1.0 0.5 3.0 0.1 0.0 0.0
material 0.8 0.8 0.9 1.0 0.0 4.0 0.1 0.0 0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment