Changeset 2907 for OpenSceneGraph/trunk/examples/osgscribe/osgscribe.cpp
- Timestamp:
- 04/22/04 10:04:34 (9 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgscribe/osgscribe.cpp
r1844 r2907 85 85 // so texturing too. 86 86 osg::StateSet* stateset = new osg::StateSet; 87 osg::Material* material = new osg::Material;88 87 osg::PolygonOffset* polyoffset = new osg::PolygonOffset; 89 88 polyoffset->setFactor(-1.0f); … … 91 90 osg::PolygonMode* polymode = new osg::PolygonMode; 92 91 polymode->setMode(osg::PolygonMode::FRONT_AND_BACK,osg::PolygonMode::LINE); 93 stateset->setAttributeAndModes(material,osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON);94 92 stateset->setAttributeAndModes(polyoffset,osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON); 95 93 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); 96 98 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 97 113 stateset->setTextureMode(0,GL_TEXTURE_2D,osg::StateAttribute::OVERRIDE|osg::StateAttribute::OFF); 98 114
