Our third animation keeps a fixed gridded data set but moves the camera angle around the full 360. We use grdview to generate a shaded-relief image sequence using the new enhanced -E option. No additional information is plotted on the image. As before we produce an animated GIF image and a simple HTML wrapper for it.
#!/bin/bash
# GMT ANIMATION 03
#
# Purpose: Make web page with simple animated GIF of Iceland topo
# GMT progs: gmt gmtset, gmt gmtmath, gmt psbasemap, gmt psxy, gmt ps2raster
# Unix progs: awk, mkdir, rm, mv, echo, convert, cat
# Note: Run with any argument to build movie; otherwise 1st frame is plotted only.
#
# 1. Initialization
# 1a) Assign movie parameters
lon=-20
lat=65
dpi=100
x0=1.5
y0=0.75
px=4
py=2.5
el=35
az=0
name=anim_03
ps=.ps
mkdir -p $$
frame=0
gmt grdclip -Sb0/-1 -G$.nc Iceland.nc
gmt grdgradient -fg -A45 -Nt1 $.nc -G$$.nc
gmt makecpt -Crelief -Z > $$.cpt
while [ -lt 360 ]; do
file=`gmt_set_framename `
if [ $# -eq 0 ]; then # If a single frame is requested we pick this view
az=135
fi
gmt grdview $.nc -R-26/-12/63/67 -JM2.5i -C$$.cpt -Qi -Bx5g10 -By5g5 -P -X0.5i -Y0.5i \
-p/+w/+v/ --PS_MEDIA=ixi > $$.ps
if [ $# -eq 0 ]; then
mv $$.ps
gmt_cleanup .gmt
gmt_abort ": First frame plotted to .ps"
fi
gmt ps2raster $$.ps -Tt -E
mv $$.tif $$/.tif
az=`expr + 5`
echo "Frame completed"
frame=`gmt_set_framenext `
done
convert -delay 10 -loop 0 $$/*.tif .gif
cat << END > .html
<HTML>
<TITLE>GMT 3-D perspective of Iceland</TITLE>
<BODY bgcolor="#ffffff">
<CENTER>
<H1>GMT 3-D perspective of Iceland</H1>
<IMG src=".gif" border=1>
</CENTER>
<HR>
Here we show ETOPO2 topography of Iceland as we move the view
point around the island.
<I>.sh: Created by on `date`</I>
</BODY>
</HTML>
END
# 4. Clean up temporary files
gmt_cleanup .gmt
Orbiting a static map.