Show
Ignore:
Timestamp:
11/24/04 20:10:44 (10 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/osgplanets/osgplanets.cpp

    r3688 r3701  
    456456        if ( image ) 
    457457        { 
    458             geodePlanet->getOrCreateStateSet()->setTextureAttributeAndModes( 0, new osg::Texture2D( image ), osg::StateAttribute::ON ); 
     458            osg::Texture2D* tex2d = new osg::Texture2D( image ); 
     459            tex2d->setWrap( osg::Texture::WRAP_S, osg::Texture::REPEAT ); 
     460            tex2d->setWrap( osg::Texture::WRAP_T, osg::Texture::REPEAT ); 
     461            geodePlanet->getOrCreateStateSet()->setTextureAttributeAndModes( 0, tex2d, osg::StateAttribute::ON ); 
    459462 
    460463            // reset the object color to white to allow the texture to set the colour. 
     
    492495 
    493496            stateset->setTextureAttribute( 1, texenv ); 
    494             stateset->setTextureAttributeAndModes( 1, new osg::Texture2D( image ), osg::StateAttribute::ON ); 
     497            osg::Texture2D* tex2d = new osg::Texture2D( image ); 
     498            tex2d->setWrap( osg::Texture::WRAP_S, osg::Texture::REPEAT ); 
     499            tex2d->setWrap( osg::Texture::WRAP_T, osg::Texture::REPEAT ); 
     500            stateset->setTextureAttributeAndModes( 1, tex2d, osg::StateAttribute::ON ); 
    495501        } 
    496502    }