|
osgearth中加入模型 没有光照效果 什么原因,代码如下:
osg::Node *m_Satellite = osgDB::readNodeFile("c:/OSG/data/sate/satellite.flt");
m_Satellite->getOrCreateStateSet()->setMode(GL_LIGHTING,osg::StateAttribute::ON);
osg::MatrixTransform *mt = new osg::MatrixTransform();
osg::Matrixd md = osg::Matrixd::translate(osg::Vec3d(0,-6950000,0));
mt->setMatrix(osg::Matrixd::scale(6900,6900,6900) * md);
mRoot->addChild(mt);
mt->addUpdateCallback(_rotationCallback);
效果如下:
|
|