3dtrial/tinyrender1_perspective/animation.sh
2024-07-24 19:18:42 -04:00

25 lines
411 B
Bash
Executable File

#!/bin/sh
if [ $# -ne 1 ]; then
echo "You must pass the basename for the animation folder"
exit 1
fi
echo "Building"
go build
mkdir -p $1
echo "Running"
frame=0
for x in $(seq -3 0.1 3); do
ff=$(printf "%03d" $frame)
./tinyrender1 "-xofs=$x" "-zofs=-1.8" "-fov=70" >"$1/$ff.ppm"
frame=$((frame + 1))
done
echo "Converting animation"
cd $1
convert -delay 5 -loop 0 *.ppm -resize 256x256 anim.gif