Regarding your subject line (FBX plugin sets material diffuse color alpha to 0), the plugin sets the alpha to whatever was in your model. See FbxMaterialToOsgStateSet::convert.
If you want to override the material in any model (FBX or otherwise), try setAttributeAndModes(material,osg::StateAttribute::OVERRIDE) On 17 February 2011 10:42, Aitor Ardanza <[email protected]> wrote: > Hi, > > Is it possible to assign a material to a node loaded from fbx plugin? > I try to do the following, but without results ... > > > Code: > osg::Group* node = > dynamic_cast<osg::Group*>(osgDB::readNodeFile("fresadora.fbx")); > osg::Material *material = new osg::Material(); > material->setDiffuse(osg::Material::FRONT_AND_BACK, > diffuse); > material->setSpecular(osg::Material::FRONT_AND_BACK, > specular); > material->setAmbient(osg::Material::FRONT_AND_BACK, > ambient); > material->setEmission(osg::Material::FRONT_AND_BACK, > emission); > material->setShininess(osg::Material::FRONT_AND_BACK, > shininess); > node > ->getOrCreateStateSet()->setAttributeAndModes(material,osg::StateAttribute::ON); > > > > > Thank you! > > Cheers, > Aitor > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=36764#36764 > > > > > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

