The short answer is that it looks the same. :-) OSG assigns each texture coordinate in your array to each vertex in your array. So if you have four vertices, then it looks like your example below, but if you have 16 vertices then you need 16 texture coordinates in your texture coordinate array.
Hope that helps, -Paul > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > Michael Aulhorn > Sent: Tuesday, February 13, 2007 9:42 AM > To: osg users > Subject: Re: [osg-users] multiple textures and one geometry > > Hi Robert, > > thanks for your help. My Problem is, I don't know exactly how > the coord. array hast to look like. To apply one texture to > the hole geometry it looks this way: > > osg::Vec2Array* texcoords = new osg::Vec2Array(4); > (*texcoords)[0].set(0.0f,0.0f); > (*texcoords)[1].set(1.0f,0.0f); > (*texcoords)[2].set(1.0f,1.0f); > (*texcoords)[3].set(0.0f,1.00f); > > How does it look like if I wan't to use a texture for > specific vertices ? > > Michael > > > Am Dienstag, den 13.02.2007, 14:10 +0000 schrieb Robert Osfield: > > Hi Michael, > > > > To do multi-texturing you simply apply multiple texture coordinate > > arrays to the osg::Geometry, one for each unit you are using use > > geometry->setTexCoordArray(unit, array); > > > > Then on the StateSet you set up the textures on each unit you do > > stateset->setTextureAttributeAndModes(unit, texture, > > osg::StateAttribute::ON); > > > > As for you pattern, I'm not quite sure what your after. > You'll just > > need to set up you tex env blending, texture borders and texture > > coordinates approrpriately. Or perhaps just break your geometry up > > into segments or use a single texture atlas. I can't > really point you > > in any particular direction though without knowing what your after. > > Sit down with an OpenGL docs to help guide yourself through it all. > > > > Robert. > > > > On 2/13/07, Michael Aulhorn > <[EMAIL PROTECTED]> wrote: > > > Hey all! I have a simple program that creates a flat > geometry with > > > 16 vertices. Now I want to apply 4 textures on it. > > > > > > One texture works of course very well, but I don't know > how to do this: > > > > > > +---+---+---+ > > > | 1 | 2 | 3 | > > > +---+---+---+ > > > | 4 | 1 | 2 | > > > +---+---+---+ > > > | 3 | 4 | 3 | > > > +---+---+---+ > > > > > > 1..4 = different textures > > > + = vertices > > > > > > I > > > > > > How has the osg::Vec2Array*'s to look like to achieve > multiple textures? > > > I think every texture needs an texture array which has to > be applied > > > to this geometry, right? And every texture array got the exact > > > amount of elements as the geometry got vertices, right? > > > > > > My approach fails. I tried to apply 2 textures but the > only thing i > > > get is a black plate with some red (one of my textures is > red) fuzzy points. > > > > > > > > > Thanks for your help. > > > > > > Michael > > > > > > > > > _______________________________________________ > > > osg-users mailing list > > > [email protected] > > > http://openscenegraph.net/mailman/listinfo/osg-users > > > http://www.openscenegraph.org/ > > > > > _______________________________________________ > > osg-users mailing list > > [email protected] > > http://openscenegraph.net/mailman/listinfo/osg-users > > http://www.openscenegraph.org/ > > > > > > _______________________________________________ > osg-users mailing list > [email protected] > http://openscenegraph.net/mailman/listinfo/osg-users > http://www.openscenegraph.org/ _______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
