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_ptr<osg::Group> root = new osg::Group; osg::ref_ptr<osg::Node> scene = osgDB::readNodeFile("wheel.obj"); if (scene.valid()) { root->addChild(scene.get()); double rgba[4] = {1.0, 0.0, 0.0, 1.0 }; osg::ref_ptr<osg::Material> material = new osg::Material; material->setDiffuse(osg::Material::FRONT_AND_BACK, osg::Vec4(rgba[0], rgba[1], rgba[2], rgba[3])); root->getOrCreateStateSet()->setAttribute(material, osg::StateAttribute::OVERRIDE); } viewer->setSceneData(root); The problem is that only some parts of the wheel are red (see attached png file). Could you please tell me what should I do to color the wheel completly? Regards, Gianni ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=43556#43556 Attachments: http://forum.openscenegraph.org//files/wheel_200.png _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org