Hi Paul Thanks for help, it was in the material data ! For the people who wants to change color or 3DS exported models, just get your node and get the geometry's material to change it.
Regards, Vincent. 2008/10/3 Paul Speed <[EMAIL PROTECTED]> > I'm by no means an expert in this area but you should dump your loaded .3ds > file as a .osg file and look and see what is causing it to be colored. As I > recall, the 3DS is loaded with materials for anything that is colored... so > setting vertex colors isn't going to help you. > > -Paul > > Vincent Bourdier wrote: > >> Up ! >> >> I anyone have a solution or and idea, I take it, otherwise I have to draw >> my geometry mysefl in OSG and it will be more complicated and less >> beautiful. >> Thanks a lot. >> >> Regards, >> Vincent. >> >> 2008/10/3 Vincent Bourdier <[EMAIL PROTECTED] <mailto: >> [EMAIL PROTECTED]>> >> >> Hi Gordon >> >> I make this : >> >> >> if(geode.valid()){ >> geode->setDataVariance(osg::Object::DYNAMIC); >> osg::ref_ptr<osg::Geometry> geom = >> geode->getDrawable(0)->asGeometry(); >> if(geom.valid()){ >> geom->dirtyDisplayList(); >> geom->setUseDisplayList(false); >> >> osg::ref_ptr<osg::Vec4Array> >> colors = new >> osg::Vec4Array(); >> colors->push_back(planeList[i].color); >> geom->setColorArray(colors.get()); >> >> geom->setColorBinding(osg::Geometry::BIND_OVERALL); >> } >> } >> >> >> But nothing changes... the color still not update ! >> >> 2008/10/3 Tomlinson, Gordon <[EMAIL PROTECTED] >> <mailto:[EMAIL PROTECTED]>> >> >> Display list are most likely on by default try this >> drawable->setUseDisplayList( false ); or if your only >> doing >> once dirty() the drawable >> ( http://www.vis-sim.com/osg/osg_faq_1.htm#f24 ) >> >> /Gordon/ >> >> __________________________________________________________ >> /Gordon Tomlinson/ >> >> /Product Manager 3D >> //Email / : gtomlinson @ overwatch.textron.com >> <http://overwatch.textron.com> >> >> __________________________________________________________ >> //(C)//:/ (+1) 571-265-2612* >> *(W)//:/ //(+1) 703-437-7651// >> >> "Self defence is not a function of learning tricks >> but is a function of how quickly and intensely one >> can arouse one's instinct for survival" >> - */Master Tambo Tetsura/* >> >> >> >> ------------------------------------------------------------------------ >> *From:* [EMAIL PROTECTED] >> <mailto:[EMAIL PROTECTED]> >> [mailto:[EMAIL PROTECTED] >> <mailto:[EMAIL PROTECTED]>] *On Behalf >> Of *Vincent Bourdier >> *Sent:* Friday, October 03, 2008 7:37 AM >> *To:* osg >> *Subject:* [osg-users] Change color of a imported node >> >> Hi all, >> >> I'm currently looking at a way to allow me changing the color of >> a geode, from a model 3D done under 3dsmax. This geode ha no >> texture, and is composed by 18 primtiveset. No color array seems >> to be in the datas, but it appear in the color applicated in >> 3dsmax. >> >> I make this : >> >> osg::ref_ptr<osg::Geode> geode = >> dynamic_cast<osg::Geode*>(node->asGroup()->getChild(0)); >> if(geode.valid()){ >> geode->setDataVariance(osg::Object::DYNAMIC); >> osg::ref_ptr<osg::Geometry> geom = >> geode->getDrawable(0)->asGeometry(); >> if(geom.valid()){ >> osg::ref_ptr<osg::Vec4Array> colors = new >> osg::Vec4Array(); >> colors->push_back(planeList[i].color); >> geom->setColorArray(colors.get()); >> >> geom->setColorBinding(osg::Geometry::BIND_OVERALL); >> } >> } >> >> >> Every thing is fine on the execution, but the geode still appear >> with the loaded color. >> >> Any Idea of How to change the color ? >> Thanks. >> >> Regards, >> >> Vincent. >> >> >> >> _______________________________________________ >> osg-users mailing list >> osg-users@lists.openscenegraph.org >> <mailto:osg-users@lists.openscenegraph.org> >> >> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >> >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> osg-users mailing list >> osg-users@lists.openscenegraph.org >> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >> > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org