diff --git a/examples/osgdistortion/osgdistortion.cpp b/examples/osgdistortion/osgdistortion.cpp index 3e4d04866..890dda41b 100644 --- a/examples/osgdistortion/osgdistortion.cpp +++ b/examples/osgdistortion/osgdistortion.cpp @@ -287,14 +287,24 @@ osg::Geometry* createDomeDistortionMesh(const osg::Vec3& origin, const osg::Vec3 osg::ArgumentParser& arguments) { double sphere_radius = 1.0; + if (arguments.read("--radius", sphere_radius)) {} + double collar_radius = 0.45; + if (arguments.read("--collar", collar_radius)) {} + osg::Vec3d center(0.0,0.0,0.0); osg::Vec3d eye(0.0,0.0,0.0); double distance = sqrt(sphere_radius*sphere_radius - collar_radius*collar_radius); + if (arguments.read("--distance", distance)) {} + + bool centerProjection = false; + osg::Vec3d projector = eye - osg::Vec3d(0.0,0.0, distance); + osg::notify(osg::NOTICE)<<"Projector position = "<getClearColor()); + osg::Node* distortionNode = createDistortionSubgraph( osgDB::readNodeFiles(arguments), viewer.getCamera()->getClearColor()); + } - // add model to the viewer. - viewer.setSceneData( distortionNode ); + + // load the nodes from the commandline arguments. + if (!viewer.getSceneData()) + { + osg::notify(osg::NOTICE)<<"Please specify a model filename on the command line."<getOrCreateStateSet()) );