Fortraneries/BloubWorld/runme.sh

75 lines
1.2 KiB
Bash
Raw Normal View History

2022-02-06 23:45:08 +01:00
#!/bin/bash
#
# how to run this mess in a batch style
#
INCFILE="bloubs.inc"
TMPPNG="/dev/shm/bloubs7.png"
2022-02-08 02:53:49 +01:00
POVOPT="+Q9 +a -v -d -W920 -H600"
2022-02-06 23:45:08 +01:00
DDIR="frames"
2022-02-07 01:50:49 +01:00
LOGERR="log.error"
2022-02-06 23:45:08 +01:00
2022-02-09 00:42:32 +01:00
NBIMG=4000
2022-02-08 18:56:51 +01:00
2022-02-06 23:45:08 +01:00
make all
err=$?
if [ $err -ne 0 ] ; then
echo 'make error = ' $err
exit 1
fi
2022-02-07 02:09:54 +01:00
2022-02-08 18:56:51 +01:00
printf "\n#declare NbImg = %d;\n" $NBIMG > nbimg.inc
2022-02-06 23:45:08 +01:00
#
# first, we have to make a seminal buch of bloubs
# --> this function need to be paraletrizable
#
2022-02-09 00:42:32 +01:00
./genbloubs in.blbs 9000
2022-02-06 23:45:08 +01:00
2022-02-08 18:56:51 +01:00
for idx in $(seq 0 $NBIMG)
2022-02-06 23:45:08 +01:00
do
echo "======== run passe $idx ========="
./exportbloubs in.blbs | awk -f toinc.awk > $INCFILE
2022-02-07 01:50:49 +01:00
povray -Iscene.pov -K${idx} -O${TMPPNG} ${POVOPT} 2> $LOGERR
2022-02-08 02:53:49 +01:00
if [ 0 -ne $? ] ; then
tail -15 $LOGERR
sleep 30
else
grep "Trace Time" $LOGERR
fi
td=$(date +'%F %R:%S')
2022-02-08 18:56:51 +01:00
txt=$(printf "%5d %s" $idx "${td}")
2022-02-06 23:45:08 +01:00
PNG=$(printf "%s/%05d.png" ${DDIR} $idx)
2022-02-08 18:56:51 +01:00
echo "$txt" | tee -a log.txt
2022-02-06 23:45:08 +01:00
convert ${TMPPNG} \
-font fixed \
2022-02-08 02:53:49 +01:00
-pointsize 20 \
2022-02-09 00:42:32 +01:00
-fill Orange \
2022-02-06 23:45:08 +01:00
-gravity south-east \
2022-02-07 01:50:49 +01:00
-annotate +15+10 "$txt" \
2022-02-06 23:45:08 +01:00
$PNG
2022-02-07 01:50:49 +01:00
echo $PNG '[done]'
2022-02-06 23:45:08 +01:00
2022-02-07 01:50:49 +01:00
./movebloubs in.blbs out.blbs
mv out.blbs in.blbs
echo
2022-02-06 23:45:08 +01:00
done
2022-02-07 01:50:49 +01:00
rm $LOGERR
2022-02-06 23:45:08 +01:00
2022-02-09 00:42:32 +01:00
# XXX convert -delay 10 -resize 50% -colors 192 \
# XXX $DDIR/????[0]*.png foo.gif
2022-02-08 02:53:49 +01:00
./encode.sh
2022-02-06 23:45:08 +01:00