Changeset 36
- Timestamp:
- Dec 2, 2004, 9:57:54 AM (20 years ago)
- Location:
- Swollen
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
Swollen/doc/contract2_priorities.txt
r35 r36 25 25 COMPLETED: 26 26 27 28 27 - Ability to remove light source (it's in the way sometimes) [2] 29 28 30 29 … … 34 33 - Optional colour coding of water surface based on arbitrary fields 35 34 (e.g. stage, speed, ..) [4] 36 - Ability to remove light source (it's in the way sometimes) [2]37 35 - Output coordinates defining camera position [?] 38 - Interactive positioning of light(s) [ 1]36 - Interactive positioning of light(s) [?] 39 37 40 38 … … 44 42 - cairns dataset reveals popping triangles (zbuffer?) 45 43 - steepcull dataset reveals steep angle cull problem 46 - nonuniform scaling into unit cube should be uniform 47 - dragging sww onto swollen (all in one directory) does not produce the same results as calling from command line (All jpg's gone and no reflection) 44 - dragging sww onto swollen (all in one directory) does not produce the same results as calling from command line 48 45 - Problems with Duncan's, Chris' and Stephen Roberts' machines at GA: Swollen won't render semi transparency. Swwiewer works fine. 49 - Swollen starts up showing first time step, not zeroth (even though clock shows zero). Stepping one forward and one back, bring things into sync. 46 50 47 51 48 … … 53 50 BUGS FIXED: 54 51 52 - Swollen starts up showing first time step, not zeroth (even though clock shows zero). Stepping one 53 forward and one back, bring things into sync. [2004-12-01] 54 - nonuniform scaling into unit cube should be uniform [2004-12-01] 55 55 - onscreen text no longer obscured by zoomed model 56 56 - removed lighting from onscreen text, now constant colour … … 69 69 - z-scaling to emphasize vertical details [1] 70 70 - Optional height-dependent semi-transparent water surface [0] 71 - Possibility of replacing graphics for bed-texture [2]72 71 73 72 … … 107 106 - Revisit use of culling steep epsilon [3] 108 107 - SWW netcdf meta information [0] 108 109 -
Swollen/include/swwreader.h
r13 r36 133 133 float _xscale, _yscale, _zscale; 134 134 float _xoffset, _yoffset, _zoffset; 135 float _xcenter, _ycenter, _zcenter; 135 136 136 137 // stack of return values from netcdf function calls -
Swollen/swollen/main.cpp
r15 r36 114 114 115 115 116 // center model in x and y (now done in swwreader)117 /*118 osg::BoundingBox bbox = bedslope->getBound();119 float scale = 1.0/bbox.radius();120 model->setPosition( -bbox.center()*scale );121 */122 123 116 // FIXME: should be reasonable default and adjustable 124 model->setScale( osg::Vec3(1.0, 1.0, 0.2) );117 model->setScale( osg::Vec3(1.0, 1.0, 1.0) ); 125 118 126 119 // sky -
Swollen/swollen/spotlight.cpp
r33 r36 41 41 _shape->setCenter( osg::Vec3(0,0,0) ); 42 42 _marker->addDrawable( new osg::ShapeDrawable(_shape) ); 43 _group->addChild(_marker); 43 44 // omit marker cone for now (FIX ME) 45 // _group->addChild(_marker); 44 46 45 47 setPosition( osg::Vec3(0,0,1) ); // default overhead -
Swollen/swollen/watersurface.cpp
r13 r36 44 44 45 45 // initial geometry 46 setTimeStep( 1);46 setTimeStep(0); 47 47 48 48 _material->setDiffuse(osg::Material::FRONT, osg::Vec4(DEF_WATER_COLOUR)); -
Swollen/swwreader/swwreader.cpp
r33 r36 102 102 float ymin, ymax, yrange; 103 103 float zmin, zmax, zrange; 104 xmin = _px[0]; 105 xmax = _px[0]; 106 ymin = _py[0]; 107 ymax = _py[0]; 108 zmin = _pz[0]; 109 zmax = _pz[0]; 104 float aspect_ratio; 105 xmin = _px[0]; xmax = _px[0]; 106 ymin = _py[0]; ymax = _py[0]; 107 zmin = _pz[0]; zmax = _pz[0]; 110 108 for( iv=1; iv < _npoints; iv++ ) 111 109 { … … 117 115 if( _pz[iv] > zmax ) zmax = _pz[iv]; 118 116 } 119 _xscale = 1.0/(xmax - xmin); _xoffset = xmin; 120 _yscale = 1.0/(ymax - ymin); _yoffset = ymin; 121 _zscale = (zmax==zmin) ? 1.0 : 1.0/(zmax - zmin); _zoffset = zmin; 122 123 #ifdef DEBUG 124 std::cout << "xmin: " << xmin << std::endl; 125 std::cout << "xmax: " << xmax << std::endl; 126 std::cout << "ymin: " << ymin << std::endl; 127 std::cout << "ymax: " << ymax << std::endl; 128 std::cout << "zmin: " << zmin << std::endl; 129 std::cout << "zmax: " << zmax << std::endl; 130 std::cout << "xscale: " << _xscale << std::endl; 131 std::cout << "yscale: " << _yscale << std::endl; 132 std::cout << "zscale: " << _zscale << std::endl; 133 #endif 117 118 xrange = xmax - xmin; 119 yrange = ymax - ymin; 120 aspect_ratio = xrange/yrange; 121 if( aspect_ratio > 1.0 ) 122 { 123 _xscale = 1.0 / xrange; 124 _xoffset = xmin; 125 _xcenter = 0.5; 126 127 _yscale = _xscale; 128 _yoffset = ymin; 129 _ycenter = 0.5 / aspect_ratio; 130 131 _zscale = _xscale; 132 _zoffset = zmin; 133 _zcenter = 0.0; 134 } 135 else 136 { 137 _yscale = 1.0 / yrange; 138 _yoffset = ymin; 139 _ycenter = 0.5; 140 141 _xscale = _yscale; 142 _xoffset = xmin; 143 _xcenter = 0.5 / aspect_ratio; 144 145 _zscale = _yscale; 146 _zoffset = zmin; 147 _zcenter = 0.0; 148 } 149 150 osg::notify(osg::INFO) << "[SWWReader] xmin: " << xmin << std::endl; 151 osg::notify(osg::INFO) << "[SWWReader] xmax: " << xmax << std::endl; 152 osg::notify(osg::INFO) << "[SWWReader] xscale: " << _xscale << std::endl; 153 osg::notify(osg::INFO) << "[SWWReader] ymin: " << ymin << std::endl; 154 osg::notify(osg::INFO) << "[SWWReader] ymax: " << ymax << std::endl; 155 osg::notify(osg::INFO) << "[SWWReader] yscale: " << _yscale << std::endl; 156 osg::notify(osg::INFO) << "[SWWReader] zmin: " << zmin << std::endl; 157 osg::notify(osg::INFO) << "[SWWReader] zmax: " << zmax << std::endl; 158 osg::notify(osg::INFO) << "[SWWReader] zscale: " << _zscale << std::endl; 159 134 160 135 161 // culling defaults … … 155 181 _bedslopevertices = new osg::Vec3Array; 156 182 for (iv=0; iv < _npoints; iv++) 157 _bedslopevertices->push_back( osg::Vec3( (_px[iv]-_xoffset)*_xscale - 0.5,158 (_py[iv]-_yoffset)*_yscale - 0.5,159 (_pz[iv]-_zoffset)*_zscale - 0.5) );183 _bedslopevertices->push_back( osg::Vec3( (_px[iv]-_xoffset)*_xscale - _xcenter, 184 (_py[iv]-_yoffset)*_yscale - _ycenter, 185 (_pz[iv]-_zoffset)*_zscale - _zcenter) ); 160 186 161 187 // load bedslope index array, pvolumes array indexes into x, y and z … … 218 244 for (iv=0; iv < _npoints; iv++) 219 245 _stagevertices->push_back( osg::Vec3( 220 (_px[iv]-_xoffset)*_xscale - 0.5,221 (_py[iv]-_yoffset)*_yscale - 0.5,222 (_pstage[iv]-_zoffset)*_zscale - 0.5) );246 (_px[iv]-_xoffset)*_xscale - _xcenter, 247 (_py[iv]-_yoffset)*_yscale - _ycenter, 248 (_pstage[iv]-_zoffset)*_zscale - _zcenter) ); 223 249 224 250 // stage index and per primitive normal and centroid arrays
Note: See TracChangeset
for help on using the changeset viewer.