Fortraneries/GravityField/raytrace.sh

51 lines
1018 B
Bash
Raw Normal View History

2022-12-03 12:25:37 +11:00
#!/bin/bash
set -e
2022-12-04 06:42:29 +11:00
POVOPT=" -q9 +a -W1280 -H1024 +WT2 -d -v "
2022-12-03 12:25:37 +11:00
SOURCE="vision.pov"
TMPF="/dev/shm/gravfield.png"
# ---------------------------------------
une_passe ()
{
clock=$1
povray -i${SOURCE} -K${clock} $POVOPT -O${TMPF} 2> pov.stderr
2022-12-04 06:42:29 +11:00
timestamp=$(date -u +'%F %H:%M' | tr '01' 'Ol')
texte=$(printf "pass %04d" $clock | tr '01' 'Ol')
outfile=$(printf "WS/troid/%05d.png" $clock)
echo $timestamp $texte $outfile
2022-12-03 12:25:37 +11:00
convert ${TMPF} \
2022-12-04 06:42:29 +11:00
-pointsize 16 \
2022-12-03 12:25:37 +11:00
-font Courier-Bold \
-fill Orange \
-annotate +10+16 "$timestamp" \
2022-12-04 06:42:29 +11:00
-annotate +10+34 "$texte" \
-pointsize 8 \
-gravity south-west \
-annotate +10+6 "tTh & Konrad" \
2022-12-03 12:25:37 +11:00
${outfile}
}
# ---------------------------------------
for foo in $(seq 0 1999)
do
echo '............' $foo
une_passe $foo
2022-12-04 06:42:29 +11:00
exit
2022-12-03 12:25:37 +11:00
done
ffmpeg -nostdin \
-loglevel warning \
2022-12-04 06:42:29 +11:00
-y -r 30 -f image2 -i WS/trid/%05d.png \
-metadata artist='---{ tTh and Konrad }---' \
2022-12-03 12:25:37 +11:00
-metadata title="Experiment on Gravity Field" \
-c:v libx264 -pix_fmt yuv420p \
bar.mp4