Show
Ignore:
Timestamp:
04/22/04 10:04:34 (11 years ago)
Author:
robert
Message:

Added pathway in code for override the colour of the wireframe scribe

Files:
1 modified

Legend:

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

    r1844 r2907  
    8585    // so texturing too. 
    8686    osg::StateSet* stateset = new osg::StateSet; 
    87     osg::Material* material = new osg::Material; 
    8887    osg::PolygonOffset* polyoffset = new osg::PolygonOffset; 
    8988    polyoffset->setFactor(-1.0f); 
     
    9190    osg::PolygonMode* polymode = new osg::PolygonMode; 
    9291    polymode->setMode(osg::PolygonMode::FRONT_AND_BACK,osg::PolygonMode::LINE); 
    93     stateset->setAttributeAndModes(material,osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON); 
    9492    stateset->setAttributeAndModes(polyoffset,osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON); 
    9593    stateset->setAttributeAndModes(polymode,osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON); 
     94 
     95#if 1 
     96    osg::Material* material = new osg::Material; 
     97    stateset->setAttributeAndModes(material,osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON); 
    9698    stateset->setMode(GL_LIGHTING,osg::StateAttribute::OVERRIDE|osg::StateAttribute::OFF); 
     99#else 
     100    // version which sets the color of the wireframe. 
     101    osg::Material* material = new osg::Material; 
     102    material->setColorMode(osg::Material::OFF); // switch glColor usage off 
     103    // turn all lighting off  
     104    material->setAmbient(osg::Material::FRONT_AND_BACK, osg::Vec4(0.0,0.0f,0.0f,1.0f)); 
     105    material->setDiffuse(osg::Material::FRONT_AND_BACK, osg::Vec4(0.0,0.0f,0.0f,1.0f)); 
     106    material->setSpecular(osg::Material::FRONT_AND_BACK, osg::Vec4(0.0,0.0f,0.0f,1.0f)); 
     107    // except emission... in which we set the color we desire 
     108    material->setEmission(osg::Material::FRONT_AND_BACK, osg::Vec4(0.0,1.0f,0.0f,1.0f)); 
     109    stateset->setAttributeAndModes(material,osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON); 
     110    stateset->setMode(GL_LIGHTING,osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON); 
     111#endif 
     112 
    97113    stateset->setTextureMode(0,GL_TEXTURE_2D,osg::StateAttribute::OVERRIDE|osg::StateAttribute::OFF); 
    98114