C++学习(三零四)osg材质Material使用

Posted hankern

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了C++学习(三零四)osg材质Material使用相关的知识,希望对你有一定的参考价值。

osg::ref_ptr<osg::Material> material = new osg::Material;
    osg::Vec4 redColor(1.0, 0.0, 0.0, 1.0);
    material->setAmbient(osg::Material::FRONT_AND_BACK, redColor);
    material->setDiffuse(osg::Material::FRONT_AND_BACK,redColor);
    material->setColorMode(osg::Material::AMBIENT);
    cow->getOrCreateStateSet()->setAttributeAndModes(material.get(), osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);

以上是关于C++学习(三零四)osg材质Material使用的主要内容,如果未能解决你的问题,请参考以下文章