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.
> 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; ?
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'
> 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