#! /bin/csh -f
# Last edited on 2008-02-04 20:20:43 by stolfi

set usage = "$0 NAME WIDTH HEIGHT MAGNIFY [AON|AOFF]"

if ( $#argv != 5) then
  echo "usage: $usage"; exit 1
endif

set name = $1; shift;
set width = $1; shift;
set height = $1; shift;
set magnify = "$1"; shift;
set smooth = $1; shift

set povpub = ${STOLFIHOME}/pkg/povray-3.1a-1/PUB/${PLATFORM}
set povray = ${povpub}/bin/x-povray
set povinc = ${povpub}/povinc/
 
echo ${name}

if ( ! ( -r ${name}.pov ) ) then
  cat ${STOLFIHOME}/bin/model.pov \
    > ${name}.pov
endif

/bin/rm -f params.inc
echo '#include "'"${name}"'.inc"' >> params.inc;
echo '#declare wd = '"${width}"';' >> params.inc;
echo '#declare ht = '"${height}"';' >> params.inc;
echo '#declare magnify = '"${magnify}"';' >> params.inc;

if ("${smooth}"  == "AON") then
  ${povray} +I${name}.pov +FP +W${width} +H${height} +A0 +R3 +D +L${povinc} -V;
else if ("${smooth}"  == "AOFF") then
  ${povray} /home/phd/lplozada/bin/animation.ini +I${name}.pov +FP +W${width} +H${height} +A0 +R3 +D +L${povinc};
endif  

display ${name}.ppm&

echo "finish"
exit 0






