>From: Carsten Neumann <[EMAIL PROTECTED]>
>Reply-To: [email protected]
>To: [email protected]
>Subject: Re: [Opensg-users] MakeTransparentGraphOp
>Date: Wed, 23 May 2007 14:25:16 +0200
>
> Hello Thomas,
>
>Thomas Weberndorfer wrote:
> > Hello,
> > I have to make parts of a scenegraph transparent and use this code:
> >
> > MakeTransparentGraphOp *op = new MakeTransparentGraphOp;
> > std::ostringstream str;
> > str << "transparency=" << alpha;
> > op->setParams ( str.str().c_str() );
> ^^^^^^^^
>you don't have to call c_str(), setParams takes a const std::string.
OK, I removed the c_str(), thanks!
> > op->traverse ( root );
> > delete op;
> >
> > But this results always in semi-transparent objects with an alpha-value
>of
> > 0.5f. I tested this code with alpha-values form 1 to 0, but i get always
>the
> > same output.
>
>Well that code snippet looks ok to me. The default value for the
>transparency is .5f so I'd guess you parameter string is not parsed
>correctly.
>Is there a warning like:
>WARNING: MakeTransparentGraphOp doesn't have parameters '%s'. ?
>What is the output of
>std::cerr << str.str() << std::endl; ?
I get no warnings like "WARNING: MakeTransparentGraphOp doesn't have
parameters '%s'. ?" and
the result of "std::cerr << str.str() << std::endl" is:
transparency=0.443 or transparency=0 or transparency=1
I loaded the tie.wrl file and applied the code snippet, but the result is
always the same ...
>If you are using debug libraries, please set the environment variable
>OSG_LOG_LEVEL to DEBUG and check if there is a line like:
>DEBUG: GraphOp::ParamSet: key='%s', value='%s'
I use the opt libraries.
>
> > Has somebody an idea?
>No, AFAICT this should work, not a clue why it doesn't, sorry.
>
> Carsten
>
>-------------------------------------------------------------------------
>This SF.net email is sponsored by DB2 Express
>Download DB2 Express C - the FREE version of DB2 express and take
>control of your XML. No limits. Just data. Click to get it now.
>http://sourceforge.net/powerbar/db2/
>_______________________________________________
>Opensg-users mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/opensg-users
_________________________________________________________________
Schneller, angenehmer und vor allem einfacher - der neue Windows Live
Messenger. http://www.communicationevolved.com/de-at/
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users