Index: /Swollen/doc/contract2_hours.txt
===================================================================
--- /Swollen/doc/contract2_hours.txt	(revision 102)
+++ /Swollen/doc/contract2_hours.txt	(revision 103)
@@ -2,4 +2,15 @@
 2nd Contract Hours
 ------------------
+
+
+8 June, Wednesday (3 hours)
+- use of xllcorner,yllcorner in sww file
+- bug that "texture" image is looking in rundir
+
+6 June, Monday (2 hours)
+- added command line specification of bedslope spotlight position (-lightpos option)
+- changed to "texture" global attribute usage
+
+
 
 total = 154 hours (4.1 weeks)
Index: /Swollen/include/swwreader.h
===================================================================
--- /Swollen/include/swwreader.h	(revision 102)
+++ /Swollen/include/swwreader.h	(revision 103)
@@ -158,4 +158,7 @@
     float _xcenter, _ycenter, _zcenter;
 
+    // sww file can contain optional global offset attributes
+    float _xllcorner, _yllcorner;
+
     // stack of return values from netcdf function calls
     std::vector<int> _status;
Index: /Swollen/swollen/main.cpp
===================================================================
--- /Swollen/swollen/main.cpp	(revision 102)
+++ /Swollen/swollen/main.cpp	(revision 103)
@@ -45,5 +45,5 @@
     arguments.getApplicationUsage()->addCommandLineOption("-alphamin <float 0-1>","Transparency value at hmin");
     arguments.getApplicationUsage()->addCommandLineOption("-alphamax <float 0-1>","Maximum transparency clamp value");
-    arguments.getApplicationUsage()->addCommandLineOption("-lightpos <float>,<float>,<float>","x,y,z of bedslope directional light (default is overhead)");
+    arguments.getApplicationUsage()->addCommandLineOption("-lightpos <float>,<float>,<float>","x,y,z of bedslope directional light (z is up, default is overhead)");
     arguments.getApplicationUsage()->addCommandLineOption("-nosky","Omit background sky");
     arguments.getApplicationUsage()->addCommandLineOption("-texture <file>","Image to use for bedslope topography");
Index: /Swollen/swollen/version.cpp
===================================================================
--- /Swollen/swollen/version.cpp	(revision 102)
+++ /Swollen/swollen/version.cpp	(revision 103)
@@ -1,1 +1,1 @@
-const char* version() { const char* s = "Revision: 98:99M"; return s; }
+const char* version() { const char* s = "Revision: 102M"; return s; }
Index: /Swollen/swwreader/swwreader.cpp
===================================================================
--- /Swollen/swwreader/swwreader.cpp	(revision 102)
+++ /Swollen/swwreader/swwreader.cpp	(revision 103)
@@ -92,4 +92,19 @@
     }
 
+    // sww file can optionally contain georeference offset
+    int status1 = nc_get_att_float(_ncid, NC_GLOBAL, "xllcorner", &_xllcorner);
+    int status2 = nc_get_att_float(_ncid, NC_GLOBAL, "yllcorner", &_yllcorner);
+    if( status1 == NC_NOERR && status2 == NC_NOERR)
+    {
+       osg::notify(osg::INFO) << "[SWWReader] xllcorner: " << _xllcorner <<  std::endl;
+       osg::notify(osg::INFO) << "[SWWReader] yllcorner: " << _yllcorner <<  std::endl;
+    }
+    else
+    {
+       _xllcorner = 0.0;  // default value
+       _yllcorner = 0.0;
+    }
+
+
     // loop index
     size_t iv;
@@ -98,20 +113,24 @@
     unsigned int v1index, v2index, v3index;
 
-    // bedslope extents and resultant scale factors
+    // bedslope range and resultant scale factors (note, these don't take into
+    // account any xllcorner, yllcorner offsets - used during texture coord assignment)
     float xmin, xmax, xrange;
     float ymin, ymax, yrange;
     float zmin, zmax, zrange;
     float aspect_ratio;
-    xmin = _px[0]; xmax = _px[0];
-    ymin = _py[0]; ymax = _py[0];
-    zmin = _pz[0]; zmax = _pz[0];
+    xmin = _px[0]; 
+    xmax = _px[0];
+    ymin = _py[0]; 
+    ymax = _py[0];
+    zmin = _pz[0]; 
+    zmax = _pz[0];
     for( iv=1; iv < _npoints; iv++ )
     {
-	    if( _px[iv] < xmin ) xmin = _px[iv];
-	    if( _px[iv] > xmax ) xmax = _px[iv];
-	    if( _py[iv] < ymin ) ymin = _py[iv];
-	    if( _py[iv] > ymax ) ymax = _py[iv];
-	    if( _pz[iv] < zmin ) zmin = _pz[iv];
-	    if( _pz[iv] > zmax ) zmax = _pz[iv];
+       if( _px[iv] < xmin ) xmin = _px[iv];
+       if( _px[iv] > xmax ) xmax = _px[iv];
+       if( _py[iv] < ymin ) ymin = _py[iv];
+       if( _py[iv] > ymax ) ymax = _py[iv];
+       if( _pz[iv] < zmin ) zmin = _pz[iv];
+       if( _pz[iv] > zmax ) zmax = _pz[iv];
     }
 
@@ -135,12 +154,21 @@
     if( aspect_ratio > 1.0 )
     {
-	_scale = 1.0 / xrange;
+	_scale = 1.0/xrange;
 	_ycenter /= aspect_ratio;
     }
     else
     {
-	_scale = 1.0 / yrange;
+	_scale = 1.0/yrange;
 	_xcenter /= aspect_ratio;
     }
+
+
+    osg::notify(osg::INFO) << "[SWWReader] xscale: " << _xscale <<  std::endl;
+    osg::notify(osg::INFO) << "[SWWReader] yscale: " << _yscale <<  std::endl;
+    osg::notify(osg::INFO) << "[SWWReader] zmin: " << zmin <<  std::endl;
+    osg::notify(osg::INFO) << "[SWWReader] zmax: " << zmax <<  std::endl;
+    osg::notify(osg::INFO) << "[SWWReader] zscale: " << _zscale <<  std::endl;
+
+
 
     // alpha-scaling defaults
@@ -149,14 +177,4 @@
     _heightmin = 0.0;
     _heightmax = 1.0;    
-
-    osg::notify(osg::INFO) << "[SWWReader] xmin: " << xmin <<  std::endl;
-    osg::notify(osg::INFO) << "[SWWReader] xmax: " << xmax <<  std::endl;
-    osg::notify(osg::INFO) << "[SWWReader] xscale: " << _xscale <<  std::endl;
-    osg::notify(osg::INFO) << "[SWWReader] ymin: " << ymin <<  std::endl;
-    osg::notify(osg::INFO) << "[SWWReader] ymax: " << ymax <<  std::endl;
-    osg::notify(osg::INFO) << "[SWWReader] yscale: " << _yscale <<  std::endl;
-    osg::notify(osg::INFO) << "[SWWReader] zmin: " << zmin <<  std::endl;
-    osg::notify(osg::INFO) << "[SWWReader] zmax: " << zmax <<  std::endl;
-    osg::notify(osg::INFO) << "[SWWReader] zscale: " << _zscale <<  std::endl;
 
 
@@ -292,5 +310,7 @@
         float yrange = _bedslopegeodata.ypixel * _bedslopegeodata.yresolution;
         for( unsigned int iv=0; iv < _npoints; iv++ )
-            _bedslopetexcoords->push_back( osg::Vec2( (_px[iv] - xorigin)/xrange, (_py[iv] - yorigin)/yrange ) );           }
+            _bedslopetexcoords->push_back( osg::Vec2( (_px[iv] + _xllcorner - xorigin)/xrange, 
+						      (_py[iv] + _yllcorner - yorigin)/yrange ) );
+    }
     else
     {
