|
发表于 2015-12-22 08:28:34
|
显示全部楼层
osg有自带的节点billboard,构建一个朝向屏幕节点,例子:
osg::Billboard* center = new osg::Billboard();
center->setMode(osg::Billboard:: POINT_ROT_EYE);
center->addDrawable(
createSquare(osg::Vec3(-0.5f,0.0f,-0.5f),osg::Vec3(1.0f,0.0f,0.0f),osg::Vec3(0.0f,0.0f,1.0f),osgDB::readImageFile("Images/reflect.rgb")),
osg::Vec3(0.0f,0.0f,0.0f));
这个节点下添加任意几何体,都可以自动实现朝向屏幕
|
|