Changeset 100


Ignore:
Timestamp:
Jun 6, 2005, 11:55:29 AM (19 years ago)
Author:
darran
Message:
  • added -lightpos x,y,z command line parameter
  • colour still looks "blown out" ... investigate this
Location:
Swollen/swollen
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Swollen/swollen/main.cpp

    r97 r100  
    4141    arguments.getApplicationUsage()->addCommandLineOption("-scale <float>","Vertical scale factor");
    4242    arguments.getApplicationUsage()->addCommandLineOption("-tps <rate>","Timesteps per second");
    43     arguments.getApplicationUsage()->addCommandLineOption("-hmin <float>","Height below which transparency is set to zero");   
    44     arguments.getApplicationUsage()->addCommandLineOption("-hmax <float>","Height above which transparency is set to alphamax");       
    45     arguments.getApplicationUsage()->addCommandLineOption("-alphamin <float 0-1>","Transparency value at hmin");   
     43    arguments.getApplicationUsage()->addCommandLineOption("-hmin <float>","Height below which transparency is set to zero");
     44    arguments.getApplicationUsage()->addCommandLineOption("-hmax <float>","Height above which transparency is set to alphamax");
     45    arguments.getApplicationUsage()->addCommandLineOption("-alphamin <float 0-1>","Transparency value at hmin");
    4646    arguments.getApplicationUsage()->addCommandLineOption("-alphamax <float 0-1>","Maximum transparency clamp value");
     47    arguments.getApplicationUsage()->addCommandLineOption("-lightpos <float>,<float>,<float>","x,y,z of bedslope directional light (default is overhead)");
    4748    arguments.getApplicationUsage()->addCommandLineOption("-nosky","Omit background sky");
    4849    arguments.getApplicationUsage()->addCommandLineOption("-texture <file>","Image to use for bedslope topography");
     
    7576        return 1;
    7677    }
    77 
    7878
    7979
     
    132132    DirectionalLight* light = new DirectionalLight(rootStateSet);
    133133    light->setPosition( osg::Vec3(0,0,2) );  // z is up
     134
     135    std::string lightposstr;
     136    while (arguments.read("-lightpos",lightposstr))
     137    {
     138        float x, y, z;
     139        int count = sscanf( lightposstr.c_str(), "%f,%f,%f", &x, &y, &z );
     140        if( count == 3 ) light->setPosition( osg::Vec3(x,y,z) );  // z is up
     141        else osg::notify(osg::WARN) << "Invalid bedslope light position \"" << lightposstr << "\"" << std::endl;
     142    }
     143
    134144
    135145
  • Swollen/swollen/version.cpp

    r99 r100  
    1 const char* version() { const char* s = "Revision: 98M"; return s; }
     1const char* version() { const char* s = "Revision: 98:99M"; return s; }
Note: See TracChangeset for help on using the changeset viewer.