From: bert's account (lberto++at++clubfed.sgi.com)
Date: 01/16/2001 11:25:05
Boris Mansencal wrote:
>
> bert's account wrote:
> >
> > if the material color mode is set to other then ' PFMTL_CMODE_OFF'
> > then Alpha is taken from the geometry color. if the geometry color
> > is opaque...... !
>
> Ok.
> So Is there a way to change only the alpha component of a pfGeoSet
> without knowing its color ?
see pfGeoSet::getAttrLists to get the list of colors which are pfVec4(takes a pointer to
See pfVec4::[] to change the alpha component!
> (The color could be set by vertex, so I would have to change the alpha
> component
> for each vertex?...)
In a word.... yes Unless your binding type is PFGS_OVERALL in which case
there is only one color . but you could do this in a package like multigen.
or add a for loop to the above. an other solution if the object is all one color
would be to copy the geoset's color to the material.
Hmmm... I wonder (since DIFFUSE alpha determines transparency) what the
effect of setting material colormode to PFMTL_CMODE_AMBIENT or
PFMTL_CMODE_EMISSION would be on the object's transparency.
>
> >
> > Boris Mansencal wrote:
> > >
> > > 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
> > > -----------------------------------------------------------------------
> > > List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> > > Open Development Project: http://oss.sgi.com/projects/performer/
> > > Submissions: info-performer++at++sgi.com
> > > Admin. requests: info-performer-request++at++sgi.com
> >
> > --
> > See Ya,
> >
> > Lawrence Eugene Bertoldi Technical Consultant
> > vnet 238-8949 Silicon Graphics
> > phone 301-572-8949 Silver Spring MD.
> > email lberto++at++clubfed.sgi.com
> >
> > ~;-}>
> > -----------------------------------------------------------------------
> > List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> > Open Development Project: http://oss.sgi.com/projects/performer/
> > Submissions: info-performer++at++sgi.com
> > Admin. requests: info-performer-request++at++sgi.com
>
> --
> Boris Mansencal
> INRIA Rocquencourt (France) - projet i3D
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Open Development Project: http://oss.sgi.com/projects/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
-- See Ya,Lawrence Eugene Bertoldi Technical Consultant vnet 238-8949 Silicon Graphics phone 301-572-8949 Silver Spring MD. email lberto++at++clubfed.sgi.com
~;-}>
This archive was generated by hypermail 2b29 : Tue Jan 16 2001 - 11:25:13 PST