Hi Ulrich

thanks - you are right - it was the wrong place


Dieter




Unclassified Mail




-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Ulrich
Hertlein
Sent: Thursday, 31 July, 2008 01:34
To: OpenSceneGraph Users
Subject: Re: [osg-users] transparency becomes dark


Hi Dieter,

Dieter Pfeffer wrote:
> I supposed that it has s.th to do with the missing material paramters; my
> idea was to change the original material of the node, therefore I set:
>
> osg::StateSet *ss = loadedModel ->getOrCreateStateSet();
> osg::Material* blendMaterial =
(osg::Material*)(ss->getAttribute(osg::StateAttribute::MATERIAL));
>
> but the material is always NULL so I don't have the original material
 >
 > Is this the wrong function call ?

The function call is correct, you're probably looking in the wrong spot ;-)

I assume 'loadedModel' is the Node returned from 'readNodeFile'?
If this is the case than most likely this is only a Group node that contains
the
rest of the scene graph.  If you take a look at e.g. 'cow.osg' (or most of
the
examples) you'll see that the Material isn't actually attached to the top
node.

What you'll need to do is traverse the scene graph and find the Material
node(s)
you're looking for.  For example you could look for a Node with a certain
name
and fetch it's Material.  Also keep in mind that Materials are attached to
StateSets which may be attached to Nodes *or* Drawables (attached to
Geodes).

Cheers!
/ulrich
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Disclaimer:

This e-mail may contain confidential and/or privileged information. If you are
not the intended recipient (or have received this e-mail in error) please 
notify the sender and delete this e-mail. Any unauthorized copying, disclosure
or distribution of the material in this e-mail is strictly forbidden.

Considering the inherent risks of the use of e-mail communication, 
Thales Nederland BV shall not be liable for any damage derived from it. 

Thales Nederland BV is seated in Hengelo (Ov.), the Netherlands, 
and registered at the Chamber of Commerce under number 06061578.

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to