Changeset 38


Ignore:
Timestamp:
Dec 6, 2004, 2:34:19 PM (20 years ago)
Author:
darran
Message:

-scale command-line parameter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Swollen/swollen/main.cpp

    r37 r38  
    3131{
    3232
    33     std::cout << argv[0] << std::endl;
    34 
    3533    // use an ArgumentParser object to manage the program arguments.
    3634    osg::ArgumentParser arguments(&argc,argv);
     
    3937    arguments.getApplicationUsage()->setDescription(arguments.getApplicationName());
    4038    arguments.getApplicationUsage()->setCommandLineUsage("swwviewer [options] swwfile ...");
    41    
     39    arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
     40    arguments.getApplicationUsage()->addCommandLineOption("-scale <s>","Vertical scale factor");
     41
    4242    // construct the viewer.
    4343    CustomViewer viewer(arguments);
     
    4646    viewer.setUpViewer(osgProducer::Viewer::STANDARD_SETTINGS);
    4747    viewer.setClearColor(osg::Vec4(DEF_BACKGROUND_COLOUR));
    48     viewer.getCamera(0)->getRenderSurface()->setWindowRectangle(550,100,640,480);
     48    //viewer.getCamera(0)->getRenderSurface()->setWindowRectangle(550,100,640,480);
    4949
    5050
     
    8181    float tps;
    8282    if( !arguments.read("-tps",tps) || tps <= 0.0 ) tps = DEF_TPS;
     83    float vscale;
     84    if( !arguments.read("-scale",vscale) ) vscale = 1.0;
     85
    8386
    8487
     
    118121
    119122    // FIXME: should be reasonable default and adjustable
    120     model->setScale( osg::Vec3(1.0, 1.0, 1.0) );
     123    model->setScale( osg::Vec3(1.0, 1.0, vscale) );
    121124
    122125    // sky
Note: See TracChangeset for help on using the changeset viewer.