Hi,
Below summary of my code attached, I create a geometry, create a
stateset and load a texture then attach this state set to the
Geometry. Problem is, if I remove the code for defining texture
coordinate indices then there is no change in the result. I mean with
or without texture and normal indices there is no change... What I
guess is; both normal and textures are sharing the main vertex
indices. If this is the case how can I define indices seperately? If
not what may be the problem?


Also there was a problem related with the news server, Messages that I
posted before couldnt be delivered. Anyway I can read the archievs.


BR



osg::Geometry* p_gePyramid = new osg::Geometry;
osg::Vec3Array* p_vaVertices = new osg::Vec3Array();

osg::DrawElementsUInt* p_deIndices = new
osg::DrawElementsUInt(osg::PrimitiveSet::QUADS, 0);

// add vertices
p_vaVertices->push_back( osg::Vec3(0, 0, 0) ); // front left
...
// add vertex indices
p_deIndices->push_back(3);
...

p_gePyramid->setVertexArray(p_vaVertices);
p_gePyramid->addPrimitiveSet(p_deIndices);


osg::Vec3Array* p_vaNormals = new osg::Vec3Array();
gePyramid->setNormalArray(p_vaNormals );
gePyramid->setNormalBinding(osg::Geometry::BIND_PER_VERTEX);

// add normals
...

// add normal indices
...

p_vaTextures = new osg::Vec2Array();
geometry->setTexCoordArray(0, p_vaTextures);

p_iaTextureIndices = new osg::UIntArray();
gePyramid->setTexCoordIndices(0, p_iaTextureIndices);

// add textures
...

// add texture indices
...
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to