Changeset 407 for experimental/distortionNG/DistortionManipulator.cpp
- Timestamp:
- Aug 5, 2012, 11:09:39 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
experimental/distortionNG/DistortionManipulator.cpp
r406 r407 308 308 return; 309 309 310 OSG_ALWAYS<<"ToDo: resetDistortion()"<<std::endl; 310 311 _distortionSet->setDistortionMeshDimensions(2, 2, true); // Reset dimensions and coordinates/texcoords & rebuild mesh data 312 updateDistortionMesh(); // Rebuild OSG Mesh (drawable) 313 // Restore ProjectionMatrix 314 315 // Set up projection Matrix as it is done in View::setUpViewOnSingleScreen( 316 double fovy, aspectRatio, zNear, zFar; 317 _camera->getProjectionMatrixAsPerspective(fovy, aspectRatio, zNear, zFar); 318 319 double newAspectRatio = double(_distortionSet->intensityMap()->width) / double(_distortionSet->intensityMap()->height); 320 double aspectRatioChange = newAspectRatio / aspectRatio; 321 if (aspectRatioChange != 1.0) 322 { 323 _camera->getProjectionMatrix() *= osg::Matrix::scale(1.0/aspectRatioChange,1.0,1.0); 324 } 325 326 311 327 } 312 328 … … 599 615 0.0 ); 600 616 vertices->push_back( tmpVec ); 601 //OSG_ALWAYS<<"Transfering mesh vertex : X:"<<tmpVec.x()<<" Y:"<<tmpVec.y()<<" Z:"<<tmpVec.z()<<std::endl;617 OSG_ALWAYS<<"Transfering mesh vertex : X:"<<tmpVec.x()<<" Y:"<<tmpVec.y()<<" Z:"<<tmpVec.z()<<std::endl; 602 618 603 619 // Note texCoords … … 606 622 607 623 texCoords->push_back(tmpTexCoords); 608 //OSG_ALWAYS<<"Transfering texcoord vertex : X:"<<tmpTexCoords.x()<<" Y:"<<tmpTexCoords.y()<<std::endl;624 OSG_ALWAYS<<"Transfering texcoord vertex : X:"<<tmpTexCoords.x()<<" Y:"<<tmpTexCoords.y()<<std::endl; 609 625 610 626 colors->push_back(osg::Vec4(1.0f,1.0f,1.0f,1.0f));
Note: See TracChangeset
for help on using the changeset viewer.