Transparency problem

New Message Reply Date view Thread view Subject view Author view

From: Boris Mansencal (boris.mansencal++at++inria.fr)
Date: 01/12/2001 09:33:39


Hi pfAll,

I have a problem with transparency.
I load a file with several objects, and I would like
to change only the alpha component for one of the
pfGeoSets. (I know the color is defined in the pfGeoSet, but
I

I have the following code (with myGeoSet being a red box for example) :
...
pfGeoState *gstate = myGeoSet->getGState()
pfMaterial *matl = new pfMaterial();
matl->setColorMode(PFMTL_FRONT, mode);
matl->setAlpha(0.3);
gstate->setAttr(PFSTATE_FRONTMTL, matl);
gstate->setMode(PFSTATE_TRANSPARENCY, PFTR_ON);
...

If mode==PFMTL_CMODE_OFF, my object is transparent, but white/grey
(the color of the pfGeoSet has no effect, it's ok.)

If mode==PFMTL_CMODE_AMBIENT_AND_DIFFUSE, my object is red but not
transparent.

Could somebody tell me what's wrong ?

Is there a better way to do this ?

Thanks a lot.

Boris.

-- 
Boris Mansencal
INRIA Rocquencourt (France) - projet i3D


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Fri Jan 12 2001 - 10:29:49 PST

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.