2022-02-16 10:18:35 +11:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
ASCFILE="nuage.asc"
|
|
|
|
IMAGE="pick3d.png"
|
|
|
|
|
|
|
|
make pickover
|
|
|
|
if [ $? -ne 0 ] ; then
|
|
|
|
echo
|
|
|
|
echo "Make error " $?
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
./pickover foo.pgm > $ASCFILE
|
|
|
|
if [ $? -ne 0 ] ; then
|
|
|
|
echo
|
|
|
|
echo "Pickover error " $?
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2022-02-16 22:15:30 +11:00
|
|
|
# ----------------------------------------------------
|
|
|
|
function plot_this_pic()
|
|
|
|
{
|
|
|
|
local imgname="$1"
|
|
|
|
local angle="$2"
|
|
|
|
|
|
|
|
printf "== %s == %3d ==\n" $imgname $angle
|
|
|
|
|
2022-02-16 10:18:35 +11:00
|
|
|
gnuplot << __EOC__
|
2022-02-16 22:15:30 +11:00
|
|
|
set term png size 800,480
|
|
|
|
set output "${imgname}"
|
2022-02-16 10:18:35 +11:00
|
|
|
|
2022-02-16 22:15:30 +11:00
|
|
|
set title "3D Pickover"
|
|
|
|
unset grid
|
|
|
|
unset tics
|
2022-02-16 10:18:35 +11:00
|
|
|
|
2022-02-16 22:15:30 +11:00
|
|
|
set view 70, $angle, 1.20
|
|
|
|
set xrange [ -2.10 : 2.10 ]
|
|
|
|
set yrange [ -2.10 : 2.10 ]
|
|
|
|
set zrange [ -1.00 : 1.00 ]
|
2022-02-16 10:18:35 +11:00
|
|
|
|
2022-02-16 22:15:30 +11:00
|
|
|
splot "${ASCFILE}" notitle with dots lt rgb "blue"
|
2022-02-16 10:18:35 +11:00
|
|
|
__EOC__
|
2022-02-16 22:15:30 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
# ----------------------------------------------------
|
|
|
|
ddir="frames"
|
|
|
|
|
|
|
|
rm $ddir/p???.png
|
|
|
|
|
|
|
|
idx=0
|
|
|
|
for angle in $(seq 0 6 360)
|
|
|
|
do
|
|
|
|
|
|
|
|
fname=$(printf "%s/p%03d.png" $ddir $idx)
|
|
|
|
|
|
|
|
plot_this_pic $fname $angle
|
|
|
|
|
|
|
|
idx=$(( idx + 1 ))
|
|
|
|
|
|
|
|
done
|
|
|
|
|
|
|
|
convert -delay 10 $ddir/p???.png pickover.gif
|
|
|
|
|
|
|
|
echo '[done]'
|
|
|
|
|
|
|
|
# ------------------------------------------ EOJ -----
|
2022-02-16 10:18:35 +11:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|