I'm sure my texture is not working because of mt tex coords and or normal?
This is what I'm currently using.
What I'm currently seeing is a quad, clearColor is correct but I'm just seeing
a faint diagonal line as the scene.
osg::Geometry* polyGeom = new osg::Geometry;
osg::Vec3Array* vertices = new osg::Vec3Array;
osg::Vec2Array* texcoords = new osg::Vec2Array;
osg::Vec2 bottom_texcoord(0.0f,0.0f);
osg::Vec2 top_texcoord(1.0f, 1.0f);
float depth = 10;
vertices->push_back(osg::Vec3(-5,depth,5));
vertices->push_back(osg::Vec3(-5,depth,-5));
texcoords->push_back(top_texcoord);
texcoords->push_back(bottom_texcoord);
vertices->push_back(osg::Vec3(5,depth,-5));
vertices->push_back(osg::Vec3(5,depth,5));
texcoords->push_back(top_texcoord);
texcoords->push_back(bottom_texcoord);
polyGeom->setVertexArray(vertices);
polyGeom->setTexCoordArray(0,texcoords);
osg::Vec3Array* normals = new osg::Vec3Array;
normals->push_back(osg::Vec3(0.0f,0.0f,1.0f));
polyGeom->setNormalArray(normals);
polyGeom->setNormalBinding(osg::Geometry::BIND_OVERALL);
osg::Vec4Array* colors = new osg::Vec4Array;
colors->push_back(osg::Vec4(1.0f,1.0f,1.f,1.0f));
polyGeom->setColorArray(colors);
polyGeom->setColorBinding(osg::Geometry::BIND_OVERALL);
polyGeom->addPrimitiveSet(new osg::DrawArrays(GL_QUADS,0,4));
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=46398#46398
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org