[GRASS-SVN] r56508 - grass-addons/grass6/display/d.anaglyph

svn_grass at osgeo.org svn_grass at osgeo.org
Thu May 30 04:18:15 PDT 2013


Author: hamish
Date: 2013-05-30 04:18:15 -0700 (Thu, 30 May 2013)
New Revision: 56508

Modified:
   grass-addons/grass6/display/d.anaglyph/d.anaglyph
Log:
narrow angle between views on a close zoom for better results

Modified: grass-addons/grass6/display/d.anaglyph/d.anaglyph
===================================================================
--- grass-addons/grass6/display/d.anaglyph/d.anaglyph	2013-05-30 08:50:11 UTC (rev 56507)
+++ grass-addons/grass6/display/d.anaglyph/d.anaglyph	2013-05-30 11:18:15 UTC (rev 56508)
@@ -319,17 +319,32 @@
       g.region n="n+$BUFDIST_EVEN" s="s-$BUFDIST_EVEN"
    fi
 
+
+   SPREAD=0.02
+   # if you get very close to the map the left and right views become too
+   #  far away from each other at the edges. (about 1cm seems to be the max)
+   # if we make it too small (0.15<s<0.0175) then nviz flips one of the scenes.
+   TWIST_L=-90
+   LARGER=`echo "$height $avg_extent" | awk '{if ($1 > $2) { print "height" } else { print "map" }}'`
+   if [ "map" = "$LARGER" ] ; then
+      SPREAD=0.005
+      TWIST_L=90
+   fi
+
+   SPREAD_L=`echo "$SPREAD" | awk '{print 0.5 - $1}'`
+   SPREAD_R=`echo "$SPREAD" | awk '{print 0.5 + $1}'`
+
    RENDER_OPTS="resolution_fine=1 perspective=15 bgcolor=black $VLINES $VPOINTS"
 
    g.message "Rendering 3D scenes ..."
 
    m.nviz.image elevation_map="$TEMP_IMG" output="$TEMPFILE.right" \
      $RENDER_OPTS size="$SIZE" height="$height" zexag="$ZEXAG" \
-     position=0.52,0.5 twist=90 --quiet &
+     position="$SPREAD_R",0.5 twist=90 --quiet &
 
    m.nviz.image elevation_map="$TEMP_IMG" output="$TEMPFILE.left" \
      $RENDER_OPTS size="$SIZE" height="$height" zexag="$ZEXAG" \
-     position=0.48,0.5 twist=-90 --quiet
+     position="$SPREAD_L",0.5 twist="$TWIST_L" --quiet
 
    check_ret
    wait



More information about the grass-commit mailing list