- Timestamp:
- 06/08/06 16:32:02 (7 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osglightpoint/osglightpoint.cpp
r4718 r5168 8 8 #include <osg/ShapeDrawable> 9 9 #include <osg/Notify> 10 #include <osg/PointSprite> 11 #include <osg/Texture2D> 12 #include <osg/BlendFunc> 10 13 11 14 #include <osgDB/Registry> … … 48 51 49 52 #undef INTERPOLATE 53 54 bool usePointSprites; 50 55 51 56 osg::Node* createLightPointsDatabase() … … 97 102 98 103 osgSim::LightPointNode* lpn = new osgSim::LightPointNode; 104 105 // 106 osg::StateSet* set = lpn->getOrCreateStateSet(); 107 108 if (usePointSprites) 109 { 110 lpn->setPointSprite(); 111 112 // Set point sprite texture in LightPointNode StateSet. 113 osg::Texture2D *tex = new osg::Texture2D(); 114 tex->setImage(osgDB::readImageFile("Images/particle.rgb")); 115 set->setTextureAttributeAndModes(0, tex, osg::StateAttribute::ON); 116 } 117 118 //set->setMode(GL_BLEND, osg::StateAttribute::ON); 119 //osg::BlendFunc *fn = new osg::BlendFunc(); 120 //fn->setFunction(osg::BlendFunc::SRC_ALPHA, osg::BlendFunc::DST_ALPHA); 121 //set->setAttributeAndModes(fn, osg::StateAttribute::ON); 122 // 123 99 124 addToLightPointNode(*lpn,start,end,noStepsX); 100 125 … … 173 198 arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ..."); 174 199 arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information"); 200 arguments.getApplicationUsage()->addCommandLineOption("--sprites","Point sprites."); 175 201 176 202 // construct the viewer. … … 189 215 return 1; 190 216 } 217 218 usePointSprites = false; 219 while (arguments.read("--sprites")) { usePointSprites = true; }; 191 220 192 221 // any option left unread are converted into errors to write out later.
