From 19ed70a6ce9ec5151a565c93a163cc466daf90f3 Mon Sep 17 00:00:00 2001 From: Don BURNS Date: Sat, 21 Aug 2004 17:29:19 +0000 Subject: [PATCH] Added back in the -s (scale) argument to osgconv, which was dropped in the last revision. --- examples/osgconv/osgconv.cpp | 62 ++++++++++++++++++++++++++++-------- 1 file changed, 48 insertions(+), 14 deletions(-) diff --git a/examples/osgconv/osgconv.cpp b/examples/osgconv/osgconv.cpp index 0efc534e2..8ca483a27 100644 --- a/examples/osgconv/osgconv.cpp +++ b/examples/osgconv/osgconv.cpp @@ -268,19 +268,27 @@ int main( int argc, char **argv ) { osgDB::Registry::instance()->loadLibrary(libName); } +#if 0 - while (arguments.read("-t",str)) - { - osg::Vec3 trans(0,0,0); - if( sscanf( str.c_str(), "%f,%f,%f", - &trans[0], &trans[1], &trans[2] ) != 3 ) - { - usage( argv[0], "Translation argument format incorrect." ); - return false; - } - oc.setTranslation( trans ); - do_convert = true; - } + if( nexti < argc ) + { + osg::Vec3 scale(0,0,0); + if( sscanf( argv[nexti++], "%f,%f,%f", + &scale[0], &scale[1], &scale[2] ) != 3 ) + { + usage( argv[0], "Scale argument format incorrect." ); + return false; + } + oc.setScale( scale ); + do_convert = true; + } + else + { + usage( argv[0], "Scale conversion option requires an argument." ); + return false; + } + break; +#endif while (arguments.read("-o",str)) { @@ -297,7 +305,7 @@ int main( int argc, char **argv ) °rees, &axis[0], &axis[1], &axis[2] ) != 4 ) { usage( argv[0], "Orientation argument format incorrect." ); - return false; + return 1; } else { @@ -310,9 +318,35 @@ int main( int argc, char **argv ) oc.setRotation( from, to ); do_convert = true; } - } + while (arguments.read("-s",str)) + { + osg::Vec3 scale(0,0,0); + if( sscanf( str.c_str(), "%f,%f,%f", + &scale[0], &scale[1], &scale[2] ) != 3 ) + { + usage( argv[0], "Scale argument format incorrect." ); + return 1; + } + oc.setScale( scale ); + do_convert = true; + } + + while (arguments.read("-t",str)) + { + osg::Vec3 trans(0,0,0); + if( sscanf( str.c_str(), "%f,%f,%f", + &trans[0], &trans[1], &trans[2] ) != 3 ) + { + usage( argv[0], "Translation argument format incorrect." ); + return 1; + } + oc.setTranslation( trans ); + do_convert = true; + } + + while (arguments.read("--compressed")) { compressTextures = true;