diff --git a/examples/osgpoints/osgpoints.cpp b/examples/osgpoints/osgpoints.cpp index b30262caa..582cbd3d6 100644 --- a/examples/osgpoints/osgpoints.cpp +++ b/examples/osgpoints/osgpoints.cpp @@ -24,7 +24,7 @@ public: { _point = new osg::Point; _point->setDistanceAttenuation(osg::Vec3(0.0,0.0005,0.0f)); - _point->setDistanceAttenuation(osg::Vec3(0.0,0.0000,0.000005f)); + _point->setDistanceAttenuation(osg::Vec3(0.0,0.0000,0.05f)); _stateset->setAttribute(_point.get()); } @@ -44,6 +44,16 @@ public: changePointSize(-1.0f); return true; } + else if (ea.getKey()=='*') + { + changePointAttenuation(1.1f); + return true; + } + else if (ea.getKey()=='/') + { + changePointAttenuation(1.0f/1.1f); + return true; + } break; } default: @@ -76,6 +86,11 @@ public: { setPointSize(getPointSize()+delta); } + + void changePointAttenuation(float scale) + { + _point->setDistanceAttenuation(_point->getDistanceAttenuation()*scale); + } osg::ref_ptr _stateset; osg::ref_ptr _point;