diff --git a/examples/osgdistortion/osgdistortion.cpp b/examples/osgdistortion/osgdistortion.cpp index 5d4f68149..e260b5431 100644 --- a/examples/osgdistortion/osgdistortion.cpp +++ b/examples/osgdistortion/osgdistortion.cpp @@ -283,8 +283,20 @@ void setDomeFaces(osgViewer::Viewer& viewer, osg::ArgumentParser& /*arguments*/) viewer.assignSceneDataToCameras(); } -osg::Geometry* createDomeDistortionMesh(const osg::Vec3& origin, const osg::Vec3& widthVector, const osg::Vec3& heightVector, osg::ArgumentParser& arguments) +osg::Geometry* createDomeDistortionMesh(const osg::Vec3& origin, const osg::Vec3& widthVector, const osg::Vec3& heightVector, + osg::ArgumentParser& arguments) { + double sphere_radius = 1.0; + double collar_radius = 0.45; + 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); + osg::Vec3d projector = eye - osg::Vec3d(0.0,0.0, distance); + + osg::notify(osg::NOTICE)<<"Projector position = "< osg::PI_2) phi = osg::PI_2; + + phi *= 2.0; + + // osg::notify(osg::NOTICE)<<"theta = "<