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
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to