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

Reply via email to