Fortraneries/Fraktalism/mkvoxvidz.sh

65 lines
1.2 KiB
Bash
Raw Normal View History

2022-04-03 06:44:24 +02:00
#!/bin/bash
echo
source "./common.sh"
make voxelize
if [ $? -ne 0 ] ; then
echo
echo "Make error " $?
exit 1
fi
2022-04-05 05:46:51 +02:00
TMPNG="/dev/shm/voxvidz.png"
2022-04-17 12:44:43 +02:00
NBIMG=1600
2022-04-15 17:13:07 +02:00
printf "#declare NbImg = %d;\n" $NBIMG | tee WS/nbimg.inc
2022-04-10 01:41:42 +02:00
2022-04-05 05:46:51 +02:00
for idx in $( seq 0 $(( NBIMG - 1)) )
2022-04-03 06:44:24 +02:00
do
dst=$(printf "frames/voxel/%05d.png" $idx)
2022-04-15 17:13:07 +02:00
delta=$( echo "scale=6 ; ${idx}/${NBIMG}" | bc -l)
2022-04-10 01:41:42 +02:00
echo "Renderbox work on "$dst" delta = " $delta
2022-04-05 05:46:51 +02:00
2022-04-15 17:13:07 +02:00
./voxelize "WS/voxels.inc" $delta
grep 'NbrVox' "WS/voxels.inc"
2022-04-03 06:44:24 +02:00
povray -ishowvoxels.pov -K$idx ${POVOPT} \
2022-04-05 05:46:51 +02:00
-O${TMPNG} 2> WS/toto.err
2022-04-03 06:44:24 +02:00
if [ $? -ne 0 ] ; then
2022-04-10 01:41:42 +02:00
echo "ERROR ERROR ERROR ERROR ERROR ERROR"
2022-04-05 05:46:51 +02:00
tail -15 WS/toto.err
sleep 20
#exit 1
2022-04-03 06:44:24 +02:00
fi
2022-04-05 05:46:51 +02:00
2022-04-15 17:13:07 +02:00
titre='Voxelisation - tTh - Avril 2022'
numbers=$(tail -1 WS/camvox.log | \
2022-04-17 12:44:43 +02:00
awk '{printf " K=%5d : %6.3f %6.3f %6.3f", \
2022-04-15 17:13:07 +02:00
$1, $2, $3, $4}')
echo "numbers " "$numbers" " txtidx " $txtidx
2022-04-05 05:46:51 +02:00
convert ${TMPNG} \
2022-04-15 17:13:07 +02:00
-fill Orange \
-kerning 2 \
-pointsize 32 \
2022-04-05 05:46:51 +02:00
-font AvantGarde-Book \
-gravity South-West \
2022-04-15 17:13:07 +02:00
-annotate +20+45 "$titre" \
-pointsize 24 \
2022-04-05 05:46:51 +02:00
-annotate +20+10 "$numbers" \
2022-04-15 17:13:07 +02:00
\
2022-04-05 05:46:51 +02:00
$dst
2022-04-03 06:44:24 +02:00
grep 'Parse Time' WS/toto.err
grep 'Trace Time' WS/toto.err
2022-10-28 21:53:57 +02:00
echo
2022-04-15 17:13:07 +02:00
2022-04-03 06:44:24 +02:00
done
2022-04-15 17:13:07 +02:00
./encode.sh frames/voxel/ voxel-3.mp4