The problem is that you can't turn texturing on for one quad in a Geometry and off for the others. Texturing has to be on for all quads. So it is difficult to answer your question because I don't know what you want to have on the other quads.
You can make it APPEAR that texturing is off for the other quads using CLAMP_TO_EDGE and setting the border of your texture appropriately. To do this, add a border to your texture -- maybe you want it white, maybe you want it to have a zero alpha, I don't know. But whatever you choose is what will be applied to the other quads. Then configure the OSG texture wrap mode for CLAMP_TO_EDGE (both S and T). Set the texture coordinates for the other vertices so that they are outside the range 0..1. For every fragment with (s,t) outside the range 0..1, that fragment will get textured with the border color. Assuming you want other textures on the other quads, use multitexturing with a different texture unit for each texture. (Note that you're typically limited to four texture units on most hardware, so this will only work for four textures.) Add a zero alpha border to all the textures, and you'll need to set TexEnv to (I think) BLEND) to get a texture per quad. As I said in my previous post, you can save yourself a lot of headache by just putting each quad in a separate Drawable with its own StateSet. :-) Hope this helps, Paul Martz Skew Matrix Software LLC http://www.skew-matrix.com 303 859 9466 > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > Michael Aulhorn > Sent: Tuesday, February 13, 2007 11:20 AM > To: osg users > Subject: RE: [osg-users] multiple textures and one geometry > > Hi Paul, > > thanks for your help. I have 16 vertices. How has the array > to look like if I want to assign only 4 vertices to my > texture and the other vertices not ? > > +---+---+---+ > | T | | | > +---+---+---+ > | | | | > +---+---+---+ > | | | | > +---+---+---+ > > My array looks like this and of course, it produces not what I want: > > osg::Vec2Array* texcoords = new osg::Vec2Array(16); > (*texcoords)[0].set(0,0); > (*texcoords)[1].set(1,0); > (*texcoords)[2].set(0,0); > (*texcoords)[3].set(0,0); > (*texcoords)[4].set(0,1); > (*texcoords)[5].set(1,1); > (*texcoords)[6].set(0,0); > (*texcoords)[7].set(0,0); > (*texcoords)[8].set(0,0); > (*texcoords)[9].set(0,0); > (*texcoords)[10].set(0,0); > (*texcoords)[11].set(0,0); > (*texcoords)[12].set(0,0); > (*texcoords)[13].set(0,0); > (*texcoords)[14].set(0,0); > (*texcoords)[15].set(0,0); > > But how can I reach this goal, that only the upper left > corner got its texture? > > > Thanks again. > > > Michael > > > > 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 > > > _______________________________________________ > 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/
