Fortraneries/GravityField/raytrace.sh

59 lines
1.1 KiB
Bash
Raw Normal View History

2022-12-03 02:25:37 +01:00
#!/bin/bash
set -e
2023-02-11 17:00:58 +01:00
POVOPT=" -q9 +a -W1280 -H1024 +WT2 -d -v "
2022-12-03 02:25:37 +01:00
SOURCE="vision.pov"
TMPF="/dev/shm/gravfield.png"
2022-12-05 12:47:51 +01:00
date > pov.stderr
2022-12-03 02:25:37 +01:00
# ---------------------------------------
une_passe ()
{
clock=$1
2022-12-05 12:47:51 +01:00
cp pov.stderr old.stderr
2022-12-03 02:25:37 +01:00
povray -i${SOURCE} -K${clock} $POVOPT -O${TMPF} 2> pov.stderr
2022-12-03 20:42:29 +01: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 02:25:37 +01:00
convert ${TMPF} \
2022-12-12 00:57:38 +01:00
-pointsize 22 \
2022-12-03 02:25:37 +01:00
-font Courier-Bold \
-fill Orange \
2022-12-12 00:57:38 +01:00
-annotate +15+22 "$timestamp" \
-annotate +15+48 "$texte" \
2023-02-11 17:00:58 +01:00
-pointsize 14 \
2022-12-03 20:42:29 +01:00
-gravity south-west \
2022-12-12 00:57:38 +01:00
-annotate +15+9 "tTh & Konrad" \
2022-12-03 02:25:37 +01:00
${outfile}
2023-02-11 17:00:58 +01:00
sleep 3
2022-12-03 02:25:37 +01:00
}
# ---------------------------------------
2022-12-15 15:03:37 +01:00
# main loop, build all that nice picz
2022-12-03 02:25:37 +01:00
for foo in $(seq 0 1999)
do
echo '............' $foo
une_passe $foo
done
ffmpeg -nostdin \
-loglevel warning \
2022-12-05 12:47:51 +01:00
-y -r 30 -f image2 -i WS/troid/%05d.png \
2022-12-03 20:42:29 +01:00
-metadata artist='---{ tTh and Konrad }---' \
2022-12-03 02:25:37 +01:00
-metadata title="Experiment on Gravity Field" \
-c:v libx264 -pix_fmt yuv420p \
2023-02-11 17:00:58 +01:00
-preset veryslow \
gravity-field.mp4
2022-12-03 02:25:37 +01:00