Changeset 103
- Timestamp:
- Jun 8, 2005, 1:29:23 PM (19 years ago)
- Location:
- Swollen
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
Swollen/doc/contract2_hours.txt
r97 r103 2 2 2nd Contract Hours 3 3 ------------------ 4 5 6 8 June, Wednesday (3 hours) 7 - use of xllcorner,yllcorner in sww file 8 - bug that "texture" image is looking in rundir 9 10 6 June, Monday (2 hours) 11 - added command line specification of bedslope spotlight position (-lightpos option) 12 - changed to "texture" global attribute usage 13 14 4 15 5 16 total = 154 hours (4.1 weeks) -
Swollen/include/swwreader.h
r92 r103 158 158 float _xcenter, _ycenter, _zcenter; 159 159 160 // sww file can contain optional global offset attributes 161 float _xllcorner, _yllcorner; 162 160 163 // stack of return values from netcdf function calls 161 164 std::vector<int> _status; -
Swollen/swollen/main.cpp
r100 r103 45 45 arguments.getApplicationUsage()->addCommandLineOption("-alphamin <float 0-1>","Transparency value at hmin"); 46 46 arguments.getApplicationUsage()->addCommandLineOption("-alphamax <float 0-1>","Maximum transparency clamp value"); 47 arguments.getApplicationUsage()->addCommandLineOption("-lightpos <float>,<float>,<float>","x,y,z of bedslope directional light ( default is overhead)");47 arguments.getApplicationUsage()->addCommandLineOption("-lightpos <float>,<float>,<float>","x,y,z of bedslope directional light (z is up, default is overhead)"); 48 48 arguments.getApplicationUsage()->addCommandLineOption("-nosky","Omit background sky"); 49 49 arguments.getApplicationUsage()->addCommandLineOption("-texture <file>","Image to use for bedslope topography"); -
Swollen/swollen/version.cpp
r100 r103 1 const char* version() { const char* s = "Revision: 98:99M"; return s; }1 const char* version() { const char* s = "Revision: 102M"; return s; } -
Swollen/swwreader/swwreader.cpp
r99 r103 92 92 } 93 93 94 // sww file can optionally contain georeference offset 95 int status1 = nc_get_att_float(_ncid, NC_GLOBAL, "xllcorner", &_xllcorner); 96 int status2 = nc_get_att_float(_ncid, NC_GLOBAL, "yllcorner", &_yllcorner); 97 if( status1 == NC_NOERR && status2 == NC_NOERR) 98 { 99 osg::notify(osg::INFO) << "[SWWReader] xllcorner: " << _xllcorner << std::endl; 100 osg::notify(osg::INFO) << "[SWWReader] yllcorner: " << _yllcorner << std::endl; 101 } 102 else 103 { 104 _xllcorner = 0.0; // default value 105 _yllcorner = 0.0; 106 } 107 108 94 109 // loop index 95 110 size_t iv; … … 98 113 unsigned int v1index, v2index, v3index; 99 114 100 // bedslope extents and resultant scale factors 115 // bedslope range and resultant scale factors (note, these don't take into 116 // account any xllcorner, yllcorner offsets - used during texture coord assignment) 101 117 float xmin, xmax, xrange; 102 118 float ymin, ymax, yrange; 103 119 float zmin, zmax, zrange; 104 120 float aspect_ratio; 105 xmin = _px[0]; xmax = _px[0]; 106 ymin = _py[0]; ymax = _py[0]; 107 zmin = _pz[0]; zmax = _pz[0]; 121 xmin = _px[0]; 122 xmax = _px[0]; 123 ymin = _py[0]; 124 ymax = _py[0]; 125 zmin = _pz[0]; 126 zmax = _pz[0]; 108 127 for( iv=1; iv < _npoints; iv++ ) 109 128 { 110 111 112 113 114 115 129 if( _px[iv] < xmin ) xmin = _px[iv]; 130 if( _px[iv] > xmax ) xmax = _px[iv]; 131 if( _py[iv] < ymin ) ymin = _py[iv]; 132 if( _py[iv] > ymax ) ymax = _py[iv]; 133 if( _pz[iv] < zmin ) zmin = _pz[iv]; 134 if( _pz[iv] > zmax ) zmax = _pz[iv]; 116 135 } 117 136 … … 135 154 if( aspect_ratio > 1.0 ) 136 155 { 137 _scale = 1.0 /xrange;156 _scale = 1.0/xrange; 138 157 _ycenter /= aspect_ratio; 139 158 } 140 159 else 141 160 { 142 _scale = 1.0 /yrange;161 _scale = 1.0/yrange; 143 162 _xcenter /= aspect_ratio; 144 163 } 164 165 166 osg::notify(osg::INFO) << "[SWWReader] xscale: " << _xscale << std::endl; 167 osg::notify(osg::INFO) << "[SWWReader] yscale: " << _yscale << std::endl; 168 osg::notify(osg::INFO) << "[SWWReader] zmin: " << zmin << std::endl; 169 osg::notify(osg::INFO) << "[SWWReader] zmax: " << zmax << std::endl; 170 osg::notify(osg::INFO) << "[SWWReader] zscale: " << _zscale << std::endl; 171 172 145 173 146 174 // alpha-scaling defaults … … 149 177 _heightmin = 0.0; 150 178 _heightmax = 1.0; 151 152 osg::notify(osg::INFO) << "[SWWReader] xmin: " << xmin << std::endl;153 osg::notify(osg::INFO) << "[SWWReader] xmax: " << xmax << std::endl;154 osg::notify(osg::INFO) << "[SWWReader] xscale: " << _xscale << std::endl;155 osg::notify(osg::INFO) << "[SWWReader] ymin: " << ymin << std::endl;156 osg::notify(osg::INFO) << "[SWWReader] ymax: " << ymax << std::endl;157 osg::notify(osg::INFO) << "[SWWReader] yscale: " << _yscale << std::endl;158 osg::notify(osg::INFO) << "[SWWReader] zmin: " << zmin << std::endl;159 osg::notify(osg::INFO) << "[SWWReader] zmax: " << zmax << std::endl;160 osg::notify(osg::INFO) << "[SWWReader] zscale: " << _zscale << std::endl;161 179 162 180 … … 292 310 float yrange = _bedslopegeodata.ypixel * _bedslopegeodata.yresolution; 293 311 for( unsigned int iv=0; iv < _npoints; iv++ ) 294 _bedslopetexcoords->push_back( osg::Vec2( (_px[iv] - xorigin)/xrange, (_py[iv] - yorigin)/yrange ) ); } 312 _bedslopetexcoords->push_back( osg::Vec2( (_px[iv] + _xllcorner - xorigin)/xrange, 313 (_py[iv] + _yllcorner - yorigin)/yrange ) ); 314 } 295 315 else 296 316 {
Note: See TracChangeset
for help on using the changeset viewer.