Ignore:
Timestamp:
Jul 20, 2012, 8:42:05 AM (12 years ago)
Author:
Torben Dannhauer
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • experimental/distortionNG/DistortionManipulator.cpp

    r398 r401  
    532532        if(_viewer.valid())
    533533        {
     534                //Update LF: Manipulator and Main Camera set to Identity Matrices
     535                _viewer->getCameraManipulator()->setByMatrix(osg::Matrix::identity());
     536                _viewer->getCamera()->setViewMatrix(osg::Matrix::identity());                   // t.b.d: Set Main Cameras' viewMatrix to Aircraft position for use in OsgVisual
     537                _viewer->getCamera()->setProjectionMatrix(osg::Matrix::identity());
     538
    534539                // Get slave struct to update the offset matrixes.
     540                //Slave Camera Settings
    535541                osgViewer::View::Slave* sceneSlave = _viewer->findSlaveForCamera( _distortionSet->getSceneCamera() );
    536 
    537542                sceneSlave->_projectionOffset = _distortionSet->getProjectionOffset();
    538543                sceneSlave->_viewOffset = _distortionSet->getViewOffset();
    539544
    540 
    541                 // LF CameraMainupulators override ViewMatrix, so they have to go...
    542                 //// alternatively, _viewer->getCameraManipulator()->setByMatrix(_distortionSet->getViewOffset()) could be set
    543                 //// but this complicates exact camera positioning and rotating
    544 
    545                 //_viewer->setCameraManipulator(0);
    546 
    547                 //_viewer->getCamera()->setViewMatrix(_distortionSet->getViewOffset());
    548                 //_viewer->getCamera()->setProjectionMatrix(_distortionSet->getProjectionOffset());
    549 
    550                 //// Print viewMatrixAsLookAt for Debug Purposes
    551                 //osg::Vec3 Eye,Focus,Vertical;
    552                 //_viewer->getCamera()->getViewMatrixAsLookAt(Eye,Focus,Vertical);
    553                 //OSG_ALWAYS<<"Camera Eyepoint: X:"<<Eye.x()<<" Y:"<<Eye.y()<<" Z:"<<Eye.z()<<std::endl;
    554                 //printf("Camera Eyepoint: %.2lf, %.2lf, %.2lf\n",Eye.x(),Eye.y(),Eye.z());
    555                 //printf("Camera Direction: %.2lf, %.2lf, %.2lf\n",Focus.x()-Eye.x(),Focus.y()-Eye.y(),Focus.z()-Eye.z());
    556                 //printf("Vertical after: %.2lf, %.2lf, %.2lf\n",Vertical.x()-Eye.x(),Vertical.y()-Eye.y(),Vertical.z()-Eye.z());
     545#if 0
     546                // Print viewMatrixAsLookAt for Debug Purposes
     547                osg::Vec3 Eye,Focus,Vertical;
     548                _viewer->getCamera()->getViewMatrixAsLookAt(Eye,Focus,Vertical);
     549                OSG_ALWAYS<<"Camera Eyepoint: X:"<<Eye.x()<<" Y:"<<Eye.y()<<" Z:"<<Eye.z()<<std::endl;
     550                printf("Camera Eyepoint: %.2lf, %.2lf, %.2lf\n",Eye.x(),Eye.y(),Eye.z());
     551                printf("Camera Direction: %.2lf, %.2lf, %.2lf\n",Focus.x()-Eye.x(),Focus.y()-Eye.y(),Focus.z()-Eye.z());
     552                printf("Vertical after: %.2lf, %.2lf, %.2lf\n",Vertical.x()-Eye.x(),Vertical.y()-Eye.y(),Vertical.z()-Eye.z());
     553#endif
     554
    557555        }
    558556        else
Note: See TracChangeset for help on using the changeset viewer.