I had to do something similar at my previous employer. The requirement was to allow users to arbitrarily drape imagery over terrain, without modifying the terrain itself. The implication: possibly multiple textures could be rendered adjacent to each other on a single triangle, a situation even more complex than yours.
Your diagram indicates that textures will not share a single primitive. If this is the case, it might be less headache to just break your primitive apart into separate Geometry objects and set a different texture for each. If you have to do it as a single Geometry, then you will have to preprocess the textures to have zero alpha at the edge, set the appropriate texture environment, then just use multitexturing as usual. -Paul > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > Michael Aulhorn > Sent: Tuesday, February 13, 2007 6:58 AM > To: [email protected] > Subject: [osg-users] multiple textures and one geometry > > 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/
