From 87798138370a710c0a371fa9b5647def9e4161ed Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 11 Jul 2007 14:16:02 +0000 Subject: [PATCH] Added support for --sky-light and headlight with local position at 0,0,0 --- examples/osgdistortion/osgdistortion.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/examples/osgdistortion/osgdistortion.cpp b/examples/osgdistortion/osgdistortion.cpp index 68d4a05a9..4a70a4d10 100644 --- a/examples/osgdistortion/osgdistortion.cpp +++ b/examples/osgdistortion/osgdistortion.cpp @@ -698,6 +698,16 @@ int main(int argc, char** argv) viewer.setSceneData( distortionNode ); } + while (arguments.read("--sky-light")) + { + viewer.setLightingMode(osg::View::SKY_LIGHT); + } + + if (viewer.getLightingMode()==osg::View::HEADLIGHT) + { + viewer.getLight()->setPosition(osg::Vec4(0.0f,0.0f,0.0f,1.0f)); + } + // load the nodes from the commandline arguments. if (!viewer.getSceneData())