Changeset 362
- Timestamp:
- Apr 22, 2012, 9:05:32 PM (13 years ago)
- Location:
- experimental/distortionNG
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
experimental/distortionNG/extViewer.cpp
r361 r362 21 21 #include <osg/Switch> 22 22 #include <osg/PolygonOffset> 23 #include <osg/PolygonMode> 23 24 #include <osg/Texture2D> 24 25 #include <osg/TextureRectangle> … … 269 270 osg::Geode* meshGeode = new osg::Geode(); 270 271 root->addChild(meshGeode, true); // Child #0 (adds mesh,shader,.. so camera renders mesh (and thus render the scene)) 271 272 272 273 273 // new we need to add the scene texture to the mesh, we do so by creating a 274 // StateSet to contain the Texture StateAttribute.274 // Modify StateSet to contain the Texture StateAttribute. 275 275 osg::StateSet* stateset = meshGeode->getOrCreateStateSet(); 276 276 stateset->setTextureAttributeAndModes(_distortionSet->getTexUnitScene(), sceneTexture,osg::StateAttribute::ON); 277 277 stateset->setMode(GL_LIGHTING,osg::StateAttribute::OFF); 278 // Modify StateSet to protectit agaiunst state changes by the stateset Manipulator 279 osg::PolygonMode* polyModeObj = new osg::PolygonMode; 280 stateset->setAttribute(polyModeObj, osg::StateAttribute::PROTECTED|osg::StateAttribute::ON); 278 281 279 282 osg::TexMat* texmat = new osg::TexMat; -
experimental/distortionNG/main.cpp
r361 r362 87 87 // add the state manipulator 88 88 viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) ); 89 //viewer.addEventHandler( new osgGA::StateSetManipulator);90 89 91 90 // add the stats handler … … 122 121 } 123 122 } 123 viewer.setSceneData( rootnode ); 124 124 125 125 // run the viewers main loop … … 199 199 * Laden des Containers. 200 200 * reset distortion funktioniert. 201 * statesetmanipulator muss auf die scene, nicht auf mesh losgehen.202 *203 201 * Anwenden der distortion auf die Meshknoten oder die texturekoordinaten 204 202 * 205 * alternativ:206 203 * - umstellung der koordinaten auf [0-1] 204 * oder alternativ: 207 205 * - speichern der hieght und width im container so daß das mesh an andere Bildschirmgrößen angepasst werden kann. 208 206
Note: See TracChangeset
for help on using the changeset viewer.