Re: [osg-users] set material basic question

2012-06-12 Thread Matthias Sattler
Hi folks, I got a similar problem. Some parts of my model are always black. Despite setting the front and back color. @Shayne: I've enabled both ambient and diffuse color. And turning the model around (which changes the direction to the light source) doesn't change the color of the black

Re: [osg-users] set material basic question

2011-11-09 Thread Gianni Ambrosio
Thank you Shayne for the explanation. It does make sense. Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=43793#43793 ___ osg-users mailing list osg-users@lists.openscenegraph.org

Re: [osg-users] set material basic question

2011-11-08 Thread Gianni Ambrosio
Hi All, I got the point. The vertex order of some faces of the wheel causes it. I modified one face of the wheel inverting the vertex order and after that modification I can see that face correctly coloured. Now, since I used the osg::Material::FRONT_AND_BACK option, why it doesn't work? In

Re: [osg-users] set material basic question

2011-11-08 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
] On Behalf Of Gianni Ambrosio Sent: Tuesday, November 08, 2011 2:39 AM To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] set material basic question Hi All, I got the point. The vertex order of some faces of the wheel causes it. I modified one face of the wheel inverting the vertex

Re: [osg-users] set material basic question

2011-11-02 Thread Gianni Ambrosio
Hi D.J. unfortunately even with OVERRIDE | ON it doesn't work. Regards Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=43684#43684 ___ osg-users mailing list osg-users@lists.openscenegraph.org

Re: [osg-users] set material basic question

2011-11-02 Thread D.J. Caldwell
Hi Gianni, In addition to the combined flag, I just noticed we are also applying the material as close to the geometry as possible. Let's say you have a top level group node that is your root. The children of that group can either be geometry nodes or other groups. In our project, when

Re: [osg-users] set material basic question

2011-11-02 Thread D.J. Caldwell
...I hate it when I do this... What about PROTECTED states? Could the nodes that aren't being correctly affected by your material have a PROTECTED state, which prevents your material from being applied? See the thread Override of an Override for more information. Good luck... D.J. On Wed,

Re: [osg-users] set material basic question

2011-11-02 Thread D.J. Caldwell
Hi, again, Gianni... I think our design approach is largely due to the fact that we only wanted to apply our material to very specific parts of the scene graph, and applying a material at a group node in our scene might cause unwanted material changes in other areas of the scene graph. So, I

Re: [osg-users] set material basic question

2011-11-02 Thread Jean-Sébastien Guay
Hi guys, ...I hate it when I do this... What about PROTECTED states? Could the nodes that aren't being correctly affected by your material have a PROTECTED state, which prevents your material from being applied? See the thread Override of an Override for more information. I just want to

Re: [osg-users] set material basic question

2011-10-27 Thread Gianni Ambrosio
Hi, great, third topic without any reply. It seems the forum works fine. Thank you! Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=43597#43597 ___ osg-users mailing list

Re: [osg-users] set material basic question

2011-10-27 Thread D.J. Caldwell
Hi Gianni, On my project, we are using OSG 2.8.3, and we combine the osg::StateAttribute::OVERRIDE flag with osg::StateAttribute::ON. You might try: [code] root-getOrCreateStateSet()-setAttribute(material, osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON); [/code] That combination seems

[osg-users] set material basic question

2011-10-26 Thread Gianni Ambrosio
Hi All, I would like to set a color to a node that comes from an obj file (attached). Here is the code I tried. You can simply use it in whatever OSG example. Code: osg::ref_ptrosg::Group root = new osg::Group; osg::ref_ptrosg::Node scene = osgDB::readNodeFile(wheel.obj); if (scene.valid()) {

Re: [osg-users] set material basic question

2011-10-26 Thread Gianni Ambrosio
It seems the first obj file has not been added to the previous message ... Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=43558#43558 ___ osg-users mailing list