]> hackdaworld.org Git - physik/posic.git/commitdiff
enhanced visualize script to create single images
authorhackbard <hackbard@sage.physik.uni-augsburg.de>
Sun, 10 Feb 2008 17:43:22 +0000 (18:43 +0100)
committerhackbard <hackbard@sage.physik.uni-augsburg.de>
Sun, 10 Feb 2008 17:43:22 +0000 (18:43 +0100)
visualize

index ab6e374ebd551c65074c3bd89b28df2bf9efe36e..8f4e83ae6c4aacd47493f560df7e9c9ae6c3a4ad 100755 (executable)
--- a/visualize
+++ b/visualize
@@ -35,6 +35,7 @@ ortographic=""
 bx0=""; by0=""; bz0="";
 bx1=""; by1=""; bz1="";
 bcr="";
+clx="0"; cly="0"; clz="0";
 
 while [ "$1" ]; do
        case "$1" in
@@ -45,6 +46,7 @@ while [ "$1" ]; do
                -nll)           x0=$2; y0=$3; z0=$4;    shift 4;;
                -fur)           x1=$2; y1=$3; z1=$4;    shift 4;;
                -c)             cx=$2; cy=$3; cz=$4;    shift 4;;
+               -L)             clx=$2; cly=$3; clz=$4; shift 4;;
                -l)             lx=$2; ly=$3; lz=$4;    shift 4;;
                -o)             ortographic=1;          shift 1;;
                -b)             bx0=$2; by0=$3; bz0=$4;
@@ -69,19 +71,23 @@ while [ "$1" ]; do
                                echo "  -b <x0> <y0> <z0> <x1> <y1> <z1>"
                                echo "povray:"
                                echo "  -c <x> <y> <z> (camera position)"
+                               echo "  -L <x> <y> <z> (camera look)"
                                echo "  -l <x> <y> <z> (light source)"
                                exit 1;;
        esac
 done
 
-if [ ! -d $directory ] ; then
-       echo "no valid directory"
-       exit 1
+POVRAY="povray -W${width} -H${height} -d" 
+
+if [ -d $directory ]; then
+       filesource=$directory/atomic_conf_*.xyz
 fi
 
-POVRAY="povray -W${width} -H${height} -d" 
+if [ -f $directory ]; then
+       filesource=$directory
+fi
 
-for file in $directory/atomic_conf_*.xyz; do
+for file in $filesource; do
 
        cat > temp.pov <<-EOF
 #include "colors.inc"
@@ -222,7 +228,7 @@ EOF
        fi
        cat >> temp.pov <<-EOF
 location $camloc
-look_at <0,0,0>
+look_at <$clx,$clz,$clz>
 }
 light_source { <0,100,-100> color White shadowless }
 EOF