|
1 我画一个矩形,然后使用Texture2D贴图,矩形的两面都有纹理,这是为什么呢?
2 顶点的顺序我是逆时针的,我用顺时针也可以,还有法线设置与否似乎没什么影响,请问法线的作用是什么?
代码:
osg::ref_ptr<osg::Vec3Array>v = new osg::Vec3Array;
v->push_back(osg::Vec3(0,0,0));
v->push_back(osg::Vec3(0,0,1));
v->push_back(osg::Vec3(1,0,1));
v->push_back(osg::Vec3(1,0,0));
//创建一个Vec2Array对象以保存纹理单元0的纹理坐标,将其关联到geom
osg::ref_ptr<osg::Vec2Array> tc= new osg::Vec2Array;
tc->push_back(osg::Vec2(0.f,0.f));
tc->push_back(osg::Vec2(1.0f,0.f));
tc->push_back(osg::Vec2(1.0f,1.0f));
tc->push_back(osg::Vec2(1.0f,0.0f));
geom->setTexCoordArray(0,tc.get());
3 请问FrontFace如何使用?
osg::ref_ptr<osg::FrontFace> frontface = new osg::FrontFace;
frontface->setMode(osg::FrontFace::COUNTER_CLOCKWISE);
似乎没有什么作用
谢谢各位! |
|