Changeset 391 for experimental/distortionNG
- Timestamp:
- Jun 30, 2012, 1:09:04 PM (12 years ago)
- Location:
- experimental/distortionNG
- Files:
-
- 4 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
experimental/distortionNG/DistortionManipulator.cpp
r387 r391 289 289 OSG_ALWAYS<<"Reseting IntensityMap Blending."<<std::endl; 290 290 291 if (!image->isDataContiguous()) 291 //isDataContiguous is unknown to MSVS2010 and GCC 292 /*if (!image->isDataContiguous()) 292 293 { 293 294 OSG_WARN<<"Warning: DistortionManipulator does not support working with non contiguous imagery as blendmaps!"<<std::endl; 294 295 return; 295 } 296 }*/ 296 297 297 298 // Fill intensity map with 255 … … 531 532 if(_viewer.valid()) 532 533 { 534 // LF CameraMainupulators override ViewMatrix, so they have to go... 535 // alternatively, _viewer->getCameraManipulator()->setByMatrix(_distortionSet->getViewOffset()) could be set 536 // but this complicates exact camera positioning and rotating 537 538 _viewer->setCameraManipulator(0); 539 533 540 _viewer->getCamera()->setViewMatrix(_distortionSet->getViewOffset()); 534 541 _viewer->getCamera()->setProjectionMatrix(_distortionSet->getProjectionOffset()); 542 543 // Print viewMatrixAsLookAt for Debug Purposes 544 osg::Vec3 Eye,Focus,Vertical; 545 _viewer->getCamera()->getViewMatrixAsLookAt(Eye,Focus,Vertical); 546 OSG_ALWAYS<<"Camera Eyepoint: X:"<<Eye.x()<<" Y:"<<Eye.y()<<" Z:"<<Eye.z()<<std::endl; 547 printf("Camera Eyepoint: %.2lf, %.2lf, %.2lf\n",Eye.x(),Eye.y(),Eye.z()); 548 printf("Camera Direction: %.2lf, %.2lf, %.2lf\n",Focus.x()-Eye.x(),Focus.y()-Eye.y(),Focus.z()-Eye.z()); 549 printf("Vertical after: %.2lf, %.2lf, %.2lf\n",Vertical.x()-Eye.x(),Vertical.y()-Eye.y(),Vertical.z()-Eye.z()); 535 550 } 536 551 else … … 554 569 0.0 ); 555 570 vertices->push_back( tmpVec ); 556 OSG_ALWAYS<<"Transfering mesh vertex : X:"<<tmpVec.x()<<" Y:"<<tmpVec.y()<<" Z:"<<tmpVec.z()<<std::endl;571 //OSG_ALWAYS<<"Transfering mesh vertex : X:"<<tmpVec.x()<<" Y:"<<tmpVec.y()<<" Z:"<<tmpVec.z()<<std::endl; 557 572 558 573 // Note texCoords -
experimental/distortionNG/DistortionSetupStrategyProjectSyntropy.cpp
r388 r391 294 294 readFrustumFromCSVFile(_frustumFilename, numFrustumValues, frustumValues); 295 295 296 osg::Matrixd viewOffset=osg::Matrix d();296 osg::Matrixd viewOffset=osg::Matrix::identity(); 297 297 osg::Matrixd projectionOffset=osg::Matrixd(); 298 298 … … 300 300 // Translational Parameters are defines in millimeters (->Correction required?!) 301 301 // Coordinate System / Directions may be looked up in "Koordinatensystem.png", trans/rot order confirmed bei PS 302 viewOffset = osg::Matrixd::translate(frustumValues[0],frustumValues[1],frustumValues[2]); 303 viewOffset*= osg::Matrixd::rotate(osg::inDegrees(frustumValues[3]), 0.0,0.0,1.0); //Heading 304 viewOffset*= osg::Matrixd::rotate(osg::inDegrees(frustumValues[4]), 1.0,0.0,0.0); //Pitch 305 viewOffset*= osg::Matrixd::rotate(osg::inDegrees(frustumValues[5]), 0.0,1.0,0.0); //Bank 306 302 osg::Matrixd rotViewOffset=osg::Matrixd(); 303 rotViewOffset.makeRotate( 304 osg::DegreesToRadians(frustumValues[3]), osg::Vec3(0,1,0), // heading 305 osg::DegreesToRadians(-frustumValues[4]), osg::Vec3(1,0,0), // pitch 306 osg::DegreesToRadians(frustumValues[5]), osg::Vec3(0,0,1)); // roll 307 308 osg::Matrixd transViewOffset=osg::Matrixd(); 309 transViewOffset.makeTranslate( frustumValues[0], frustumValues[1], frustumValues[2]); 310 311 viewOffset = viewOffset * rotViewOffset; // * transViewOffset; 312 307 313 //Frustum Parameters: Left, Right, Bottom, Top, zNear, zFar 308 //Alternative: viewer->camera->setprojectionmatrixasfrustum?309 314 projectionOffset.makeFrustum(osg::inDegrees(frustumValues[6]), osg::inDegrees(frustumValues[7]), osg::inDegrees(frustumValues[8]), osg::inDegrees(frustumValues[9]), zNear, zFar); 310 315 -
experimental/distortionNG/main.cpp
r389 r391 132 132 if (!rootnode) 133 133 { 134 osgDB::Registry::instance()->getDataFilePathList().push_front("H:\\AllInOnDB");135 rootnode = osgDB::readNodeFile(" H:\\AllInOnDB\\terrain.osgb");134 //osgDB::Registry::instance()->getDataFilePathList().push_front("H:/AllInOnDB"); 135 rootnode = osgDB::readNodeFile("resources/TestSphere/sphere_500.obj"); 136 136 if(!rootnode) 137 137 {
Note: See TracChangeset
for help on using the changeset viewer.