Hi, everyone! I'm on a small program and I meet a problem. These are what we
do:
1. click on a model, and then use osgUtil::PolytopeIntersector and related
methods to find which model has been clicked (selected).
2. and the scene is like this: node1->node2->node3->leaf
3. after find the leaf and we trace back to node1
4. we give a stateset with a blue material to node1:
osg::Vec4 diff(0.0f, 0.99f, 0.9f, 0.0f);
osg::ref_ptr<osg::Material> pMaterial = new
osg::Material;
pMaterial->setColorMode(osg::Material::AMBIENT_AND_DIFFUSE);
pMaterial->setDiffuse(osg::Material::FRONT_AND_BACK,
diff);
pStateSet_of_Node1->setAttributeAndModes(pMaterial.get(),
osg::StateAttribute::OVERRIDE);
5. some models are quite successful with this way, but some models just
become invisible.
6. I check the invisible models and find a stateset of their own node2, it
is like this:
StateSet {
rendering_hint DEFAULT_BIN
renderBinMode USE
binNumber 10
binName DepthSortedBin
}
7. I did two tests: i). copy the code above to an osg file which was
successfu, and it fails and becomes invisible. ii) I append some codes to
those in step 4, and set the stateset of node1 with rendering options just
like step 6. Then everything just disappears.
Can you help me out of this, I don't know whether I've explain this clearly.
Thank you!
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org