Show
Ignore:
Timestamp:
11/24/04 20:10:44 (9 years ago)
Author:
robert
Message:

from Mike Weiblen, added wrap mode to planet texture to avoid black seam, and
add option of specifying the texture to use in osgshape.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgshape/osgshape.cpp

    r2767 r3701  
    1313#include "../osghangglide/terrain_coords.h" 
    1414 
    15 osg::Geode* createShapes() 
     15osg::Geode* createShapes( char* img_filename ) 
    1616{ 
    1717    osg::Geode* geode = new osg::Geode(); 
     
    2222    osg::StateSet* stateset = new osg::StateSet(); 
    2323 
    24     osg::Image* image = osgDB::readImageFile("Images/lz.rgb"); 
     24    if( ! img_filename ) img_filename = "Images/lz.rgb"; 
     25    osg::Image* image = osgDB::readImageFile( img_filename ); 
     26 
    2527    if (image) 
    2628    { 
     
    9294    // set up the usage document, in case we need to print out how to use this program. 
    9395    arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is the example which demonstrates the osg::Shape classes."); 
    94     arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ..."); 
     96    arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] [image_filename]"); 
    9597    arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information"); 
    9698    
     
    120122        return 1; 
    121123    } 
     124 
     125    char* img_filename = 0; 
     126    for( int pos = 1; pos < arguments.argc(); ++pos ) 
     127    { 
     128        if( arguments.isString(pos) ) 
     129        { 
     130            img_filename = arguments[pos]; 
     131            break; 
     132        } 
     133    } 
    122134     
    123     osg::Node* node = createShapes(); 
     135    osg::Node* node = createShapes( img_filename ); 
    124136 
    125137    // add model to viewer.