Ignore:
Timestamp:
Sep 4, 2011, 9:13:25 PM (13 years ago)
Author:
Torben Dannhauer
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • experimental/distortionNG/extViewer.cpp

    r314 r315  
    1616extViewer::extViewer(osg::ArgumentParser& arguments) : Viewer(arguments)
    1717{
    18 //      setUpViewForManualDistortion(0);
     18
    1919}
    2020
     
    2929}
    3030
    31 void extViewer::setUpViewForManualDistortion(osg::Image* intensityMap, unsigned int screenNum)
     31void extViewer::setUpViewForManualDistortion(unsigned int screenNum, osg::Image* intensityMap, const osg::Matrixd& projectorMatrix)
    3232{
    3333        OSG_INFO<<"View::setUpViewForManualDistortion(sn="<<screenNum<<", im="<<intensityMap<<")"<<std::endl;
     
    9999    {
    100100        osg::ref_ptr<osg::Camera> camera = new osg::Camera;
    101         camera->setName("Scene camera");
     101        camera->setName("Scene cam");
    102102        camera->setGraphicsContext(gc.get());
    103103        camera->setViewport(new osg::Viewport(0,0,camera_width, camera_height));
     
    117117    {
    118118        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));
    121121
    122122        // new we need to add the texture to the mesh, we do so by creating a
     
    225225
    226226
    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;
    235235        texture->setImage( osgDB::readImageFile("Images/osg256.png") );
    236236        texture->setFilter( osg::Texture2D::MIN_FILTER, osg::Texture2D::LINEAR_MIPMAP_LINEAR );
    237237        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() );*/
    239239
    240240        // Create normals
    241         osgUtil::SmoothingVisitor::smooth( *geom );
     241        //osgUtil::SmoothingVisitor::smooth( *geom );
    242242
    243243        return geom.release();
Note: See TracChangeset for help on using the changeset viewer.