Changeset 315 for experimental/distortionNG/extViewer.cpp
- Timestamp:
- Sep 4, 2011, 9:13:25 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
experimental/distortionNG/extViewer.cpp
r314 r315 16 16 extViewer::extViewer(osg::ArgumentParser& arguments) : Viewer(arguments) 17 17 { 18 // setUpViewForManualDistortion(0); 18 19 19 } 20 20 … … 29 29 } 30 30 31 void extViewer::setUpViewForManualDistortion( osg::Image* intensityMap, unsigned int screenNum)31 void extViewer::setUpViewForManualDistortion(unsigned int screenNum, osg::Image* intensityMap, const osg::Matrixd& projectorMatrix) 32 32 { 33 33 OSG_INFO<<"View::setUpViewForManualDistortion(sn="<<screenNum<<", im="<<intensityMap<<")"<<std::endl; … … 99 99 { 100 100 osg::ref_ptr<osg::Camera> camera = new osg::Camera; 101 camera->setName("Scene cam era");101 camera->setName("Scene cam"); 102 102 camera->setGraphicsContext(gc.get()); 103 103 camera->setViewport(new osg::Viewport(0,0,camera_width, camera_height)); … … 117 117 { 118 118 osg::Geode* geode = new osg::Geode(); 119 //geode->addDrawable(createParoramicSphericalDisplayDistortionMesh(osg::Vec3(0.0f,0.0f,0.0f), osg::Vec3(width,0.0f,0.0f), osg::Vec3(0.0f,height,0.0f), radius, collar, applyIntensityMapAsColours ? intensityMap :0, projectorMatrix));120 geode->addDrawable(createMesh(16 , 19));119 //geode->addDrawable(createParoramicSphericalDisplayDistortionMesh(osg::Vec3(0.0f,0.0f,0.0f), osg::Vec3(width,0.0f,0.0f), osg::Vec3(0.0f,height,0.0f), 1, 0.45, 0, projectorMatrix)); 120 geode->addDrawable(createMesh(160, 190)); 121 121 122 122 // new we need to add the texture to the mesh, we do so by creating a … … 225 225 226 226 227 osg::ComputeBoundsVisitor cbv;228 cbv.applyDrawable(geom);229 osg::BoundingBox box = cbv.getBoundingBox();230 if (!box.valid())231 std::cout << "Invalid bounding box!";232 geom->setInitialBound(box);233 234 osg::ref_ptr<osg::Texture2D> texture = new osg::Texture2D;227 //osg::ComputeBoundsVisitor cbv; 228 //cbv.applyDrawable(geom); 229 //osg::BoundingBox box = cbv.getBoundingBox(); 230 //if (!box.valid()) 231 // std::cout << "Invalid bounding box!"; 232 //geom->setInitialBound(box); 233 234 /*osg::ref_ptr<osg::Texture2D> texture = new osg::Texture2D; 235 235 texture->setImage( osgDB::readImageFile("Images/osg256.png") ); 236 236 texture->setFilter( osg::Texture2D::MIN_FILTER, osg::Texture2D::LINEAR_MIPMAP_LINEAR ); 237 237 texture->setFilter( osg::Texture2D::MAG_FILTER, osg::Texture2D::LINEAR_MIPMAP_LINEAR ); 238 geom->getOrCreateStateSet()->setTextureAttributeAndModes( 0, texture.get() ); 238 geom->getOrCreateStateSet()->setTextureAttributeAndModes( 0, texture.get() );*/ 239 239 240 240 // Create normals 241 osgUtil::SmoothingVisitor::smooth( *geom );241 //osgUtil::SmoothingVisitor::smooth( *geom ); 242 242 243 243 return geom.release();
Note: See TracChangeset
for help on using the changeset viewer.