Fortraneries/Fraktalism/mkvoxvidz.sh

57 lines
1.1 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
./voxelize > WS/voxels.dat
./vox2inc.awk < WS/voxels.dat > WS/voxels.inc
2022-04-10 01:41:42 +02:00
grep NbrVox WS/voxels.inc
2022-04-03 06:44:24 +02:00
2022-04-05 05:46:51 +02:00
TMPNG="/dev/shm/voxvidz.png"
NBIMG=360
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-10 01:41:42 +02:00
delta=$( echo "scale=6 ; ${idx}/360" | bc -l)
echo "Renderbox work on "$dst" delta = " $delta
2022-04-05 05:46:51 +02:00
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-10 01:41:42 +02:00
titre='Voxelisation - tTh - avril 2022'
2022-04-05 05:46:51 +02:00
numbers=$(tail -1 WS/camvox.log | \
2022-04-10 01:41:42 +02:00
awk '{printf " %6.3f %6.3f %6.3f", $1, $2, $3}')
echo "$numbers"
2022-04-05 05:46:51 +02:00
convert ${TMPNG} \
2022-04-10 01:41:42 +02:00
-fill Gray70 \
2022-04-05 05:46:51 +02:00
-kerning 1 \
2022-04-10 01:41:42 +02:00
-pointsize 24 \
2022-04-05 05:46:51 +02:00
-font AvantGarde-Book \
-gravity South-West \
-annotate +20+32 "$titre" \
-annotate +20+10 "$numbers" \
$dst
2022-04-03 06:44:24 +02:00
grep 'Parse Time' WS/toto.err
grep 'Trace Time' WS/toto.err
done
2022-04-10 01:41:42 +02:00
./encode.sh frames/voxel/ voxel-2.mp4