Hi,
I am using TGS OpenInventor 3.0, win32 version, and find out a strange
problem as following:
I register my callback routine via
"addPostCallback(SoMaterial::getClassTypeId(),_MaterialCB,pAct)". Within the
_MaterialCB,I query the transparency value by
SoCallbackAction::getMaterial():
... _MaterialCB(...){
...
float trans;
pAct->getMaterial(...,trans,0);
...
}
The problem is: When SoCallbackAction traversing a scenegraph with two
cascading SoMaterial nodes, if the second material's transparency is ZERO,
it does not get a correct ZERO value, instead the previous material's
transparency is returned. If I set the second material's transparency to
0.00001, a very little value, then it does return a 0.00001. Other fields
of SoMaterial have not such a problem.
-------Sample scenegraph:--------
#Inventor V2.1 ascii
Separator {
#First material
Material {
diffuseColor 0 0.501961 1
transparency 0.4
}
Sphere {
radius 1.3
}
#Second material
Material {
diffuseColor 0.501961 1 0.501961
transparency 0 //Problem!
}
Cube {
}
Any suggestions?Quote:}
Thanks.
D.J.
2003/4/9