#!/bin/bash #------------------------------# # Animation Indoor # #------------------------------# source ./configuration.sh DDIR="frames/indoor" TMPF="/dev/shm/tmp.png" FIMGDIR="/silo/a/tth/Roulotte/" POVOPT=" -d +q9 -a +W1440 +H1080 -v +WT8" # ------------------------------------------------------------ # # dynamic failure picture # mk_fail_pic () { src=$1 dst=$2 echo "mk fail pic from" $src "to" $dst line=$(( 200 + ($RANDOM % 600) )) column=$(( 200 + ($RANDOM % 600) )) convert $src \ -font Lato-Bold-Italic \ -pointsize 118 \ -kerning 10 \ -fill Red \ -annotate +${line}+${column} 'EPIC FAIL !' \ $dst } # ------------------------------------------------------------ raytrace () { echo "++++++ raytracing " $1 $2 debut=$(date +"%s") povray -Iindoor.pov -K$1 $POVOPT -O$TMPF 2> WS/pov.stderr if [ $? -ne 0 ] then mk_fail_pic failure.png $2 tail -12 WS/pov.stderr sleep 99 else txt=$(printf "%04d" $1 | tr '0' 'o') convert $TMPF \ -alpha off \ -pointsize 88 \ -kerning 46 \ -fill $COLTEXT_A \ -stroke $COLTEXT_B \ -strokewidth 2 \ -font Courier-Bold \ -gravity South-East \ -annotate +145+38 "$txt" \ computed.png mv computed.png $2 # echo $txt fi fin=$(date +"%s") # echo timing $debut $fin echo $1 $((fin-debut)) | tee -a WS/chrono.indoor } # --------------------------------- MAIN --------------------- NBIMG=2000 printf "#declare NbImg = %d;\n" $NBIMG > WS/nbimg.inc for idx in $( seq 0 $((NBIMG-1)) ) do ### foo=$(( (idx+45) % 480 )) ### rushpic=$(printf "../%s/%04d.png" "frames/rush" $foo) ### # echo "rushpic " $rushpic >> toto ### ln -s -f $rushpic WS/rushpic.png ### foo=$(( idx % 340 )) ### wallpic=$(printf "../%s/%04d.png" "Wallpicz" $foo) ### # echo "wallpic " $wallpic >> toto ### ln -s -f $wallpic WS/roulotte.png # afficher le futur sur l'ecran foo=$(( ( idx + 397 ) % NBIMG )) futur=$(printf "%s/%04d.png" $DDIR $foo) if [ -r $futur ] then ln -sf ../$futur WS/tableau.png # echo $futur OK else echo $futur not available ln -sfv $PWD/panneau.png WS/tableau.png fi img=$(printf "%s/%04d.png" $DDIR $idx) # echo image $img raytrace $idx $img sleep 20 done ./encode.sh # ----------------------------- the end ---------