Changeset 73
- Timestamp:
- Dec 23, 2004, 7:16:44 PM (20 years ago)
- Location:
- Swollen
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
Swollen/doc/contract2_hours.txt
r72 r73 3 3 ------------------ 4 4 5 23 December, Thursday (4 hours) 6 - bedslope lighting 5 7 6 8 22 December, Wednesday (4 hours) -
Swollen/doc/contract2_priorities.txt
r68 r73 28 28 29 29 30 30 31 COMPLETED: 31 32 … … 34 35 - added -nosky command-line option to appease those who want a plain background [?] 35 36 - add -version command line flag synced with Subversion revision number (useful for debugging) [?] 36 37 - Interactive positioning of light(s) [0] 38 - Ability to have shading on bed-surface. This was the case with 39 distro31052004 and is very useful with large scale topographies. 40 Please have a look at the file Hobart_first_order_size77670.sww using 41 both swwviewer and swollen and let Ole know what you think. 42 Perhaps default to that standard background in the absence of bedslope.jpg 43 or perhaps tie in with the geotiff item by having such a default behaviour. 37 44 38 45 … … 44 51 - Output coordinates defining camera position [?] 45 52 - Ability to handle scenes with a resolution of 500,000+ triangles [3] 46 - Interactive positioning of light(s) [0]47 - Ability to have shading on bed-surface. This was the case with48 distro31052004 and is very useful with large scale topographies.49 Please have a look at the file Hobart_first_order_size77670.sww using50 both swwviewer and swollen and let Ole know what you think.51 Perhaps default to that standard background in the absence of bedslope.jpg52 or perhaps tie in with the geotiff item by having such a default behaviour.53 53 54 54 … … 62 62 - Problems with Duncan's, Chris' and Stephen Roberts' machines at GA: Swollen won't render semi 63 63 transparency. Swwviewer works fine. (This appeared to work on Dunca's computer 13/12/4?). 64 - toggle wireframe not working on Mac 64 65 65 66 66 67 67 BUGS FIXED: 68 68 69 - toggle wireframe not working on Mac 69 70 - can no longer make model disappear by pushing back through sky [2004-12-15] 70 71 - Swollen starts up showing first time step, not zeroth (even though clock shows zero). Stepping one … … 75 76 - memory leak occurring when loading subsequent stages fixed by use 76 77 of ref_ptrs in SWWReader 78 77 79 78 80 -
Swollen/swollen/directionallight.cpp
r72 r73 22 22 _light = new osg::Light; 23 23 _light->setLightNum(num); 24 _light->setPosition( osg::Vec4(0,0,1,0) ); 25 _light->setAmbient( osg::Vec4(0.7,0.7,0.7,1) ); 26 _light->setDiffuse( osg::Vec4(1,1,1,1) ); 27 _light->setSpecular( osg::Vec4(1,1,1,1) ); 24 25 // homogeneous coordinates (x,y,z,w), w=0 indicates position at infinity 26 _light->setPosition( osg::Vec4( 0, 0, 1, 0 ) ); 27 28 _light->setAmbient( osg::Vec4( 0.7, 0.7, 0.7, 1.0 ) ); 29 _light->setDiffuse( osg::Vec4( 1.0, 1.0, 1.0, 1.0 ) ); 30 _light->setSpecular( osg::Vec4( 1.0, 1.0, 1.0, 1.0) ); 28 31 29 32 // Scenegraph node … … 35 38 _transform->addChild( _source ); 36 39 37 // create marker cylinder and rotate towards origin 38 _marker = new osg::Geode; 39 _marker->setName("directionallight"); 40 _shape = new osg::Cylinder; 41 _shape->setRadius( DEF_DEFAULT_CYLINDER_RADIUS ); 42 _shape->setHeight( DEF_DEFAULT_CYLINDER_HEIGHT ); 43 _shape->setCenter( osg::Vec3(0,0,0) ); 44 _marker->addDrawable( new osg::ShapeDrawable(_shape) ); 40 41 // marker geometry, texture and state 42 _marker = osgDB::readNodeFile( "light.osg" ); 45 43 _transform->addChild( _marker ); 46 47 // marker geometry texture48 osg::Texture2D* texture = new osg::Texture2D;49 texture->setDataVariance( osg::Object::STATIC );50 texture->setBorderColor( osg::Vec4(1.0f,1.0f,1.0f,0.5f) );51 texture->setWrap( osg::Texture::WRAP_S, osg::Texture::REPEAT );52 texture->setImage( osgDB::readImageFile("../images/gastacked.jpg") );53 54 // state55 _stateset = new osg::StateSet;56 _stateset->setTextureAttributeAndModes( 0, texture, osg::StateAttribute::ON );57 _marker->setStateSet( _stateset );58 44 59 45 … … 65 51 void DirectionalLight::setPosition(osg::Vec3 v) 66 52 { 53 54 //std::cout << "[DirectionalLight::setPosition] vector = " << v << std::endl; 67 55 osg::Vec3 origindir; 68 56 osg::Quat quat; -
Swollen/swollen/directionallight.h
r72 r73 51 51 osg::LightSource* _source; 52 52 53 osg:: Geode* _marker;53 osg::Node* _marker; 54 54 osg::Cylinder* _shape; 55 55 osg::Geometry* _geom; -
Swollen/swollen/main.cpp
r72 r73 57 57 viewer.setUpViewer( osgProducer::Viewer::STANDARD_SETTINGS ); 58 58 viewer.setClearColor( osg::Vec4(DEF_BACKGROUND_COLOUR) ); 59 viewer.getCamera(0)->getRenderSurface()->setWindowRectangle(200, 100,800,600);59 viewer.getCamera(0)->getRenderSurface()->setWindowRectangle(200,300,800,600); 60 60 viewer.getCullSettings().setComputeNearFarMode( osg::CullSettings::COMPUTE_NEAR_FAR_USING_PRIMITIVES ); 61 61 … … 137 137 // Lighting 138 138 DirectionalLight* light = new DirectionalLight(rootStateSet); 139 light->setPosition( osg::Vec3(0,1,0) ); // z is up 140 // spotlight->setSpotAngle( 45.0 ); 139 light->setPosition( osg::Vec3(0,0,2) ); // z is up 141 140 142 141 … … 181 180 182 181 // initial light position 183 CustomTrackballManipulator* trackball = viewer.getTrackball(); 184 trackball->setNode( model ); 185 trackball->setAutoComputeHomePosition( false ); 186 trackball->setHomePosition( 187 osg::Vec3d(0,1,0), // location 188 osg::Vec3d(0,0,0), // target 189 osg::Vec3d(0,0,1) ); // up vector 190 trackball->moveToHome(); 191 trackball->disable(); 182 CustomTrackballManipulator* lightmanipulator = viewer.getTrackball(); 183 lightmanipulator->setNode( model ); 184 lightmanipulator->setAutoComputeHomePosition( false ); 185 lightmanipulator->setByInverseMatrix( osg::Matrixd( -0.707107, -0.408248, 0.57735, 0.0, 186 0.0, 0.816497, 0.57735, 0.0, 187 -0.707107, 0.408248, -0.57735, 0.0, 188 0.0, 0.0, 2.0, 1.0 ) ); 189 lightmanipulator->disable(); 192 190 193 191 … … 227 225 228 226 // light position manipulator 229 if( trackball->isEnabled() )227 if( lightmanipulator->isEnabled() ) 230 228 { 231 //osg::Matrixd matrix = trackball->getInverseMatrix();232 osg::Matrixd matrix = trackball->getMatrix();229 osg::Matrixd matrix = lightmanipulator->getInverseMatrix(); 230 //std::cout << matrix << std::endl; 233 231 osg::Vec3d position = matrix.getTrans(); 234 //std::cout << "trackball position x: " << position. << std::endl; 235 light->setPosition( -position ); 232 light->setPosition( position ); 236 233 } 237 234 … … 244 241 if( event_handler->toggleManipulatorMode() ) 245 242 { 246 if( trackball->isEnabled() )243 if( lightmanipulator->isEnabled() ) 247 244 { 248 trackball->disable();245 lightmanipulator->disable(); 249 246 terrainmanipulator->enable(); 250 247 light->hide(); … … 252 249 else 253 250 { 254 trackball->enable();251 lightmanipulator->enable(); 255 252 terrainmanipulator->disable(); 256 253 light->show(); -
Swollen/swollen/version.cpp
r72 r73 1 const char* version() { const char* s = "Revision: 7 0:71M"; return s; }1 const char* version() { const char* s = "Revision: 72M"; return s; } -
Swollen/swollen/watersurface.cpp
r72 r73 19 19 #include <osgUtil/TriStripVisitor> 20 20 21 #define DEF_ALPHA_THRESHOLD 0.0 121 #define DEF_ALPHA_THRESHOLD 0.05 22 22 23 23
Note: See TracChangeset
for help on using the changeset viewer.