Hi Ku, You can't assign two textures in quite the way you are looking for, but your can certainly achieve the results you are looking for, an even doing by several different ways.
One of the easiest ways ways would be to have one osg::Geometry that has the planar geometry you want, then have two osg::Geode that you attach this geometry to. Then on each of these osg::Geode you assign a StateSet with the Texture you want. The final trick to make it all work is to enable GL_CULL_FACE and swap which face is culled by the OpenGL triangle rasterization step by using osg::CullFace and assign one branch to cull the FRONT and the other the BACK. Robert. On Fri, Jul 30, 2010 at 1:21 PM, Ku Krapox <[email protected]> wrote: > Hi all, > > I'm trying to create a simple, planar figure, covered by two rectangular > textures, one on each face. > For now I couldn't find a better way than creating two geometries very close > to each other and fill each one with a different texture. > > It looks fine while the geometry doesn't change too much, but if I displace > the vertices the two geometries start to overlap which result in an ugly mix > of the two textures. And I can't do anything about it because of the complex > deformation of my object... > > So I had this idea : is there a way to display different textures on each > side of a single geometry? With osg::Geometry::setTexCoordArray maybe?? > If not, I could get by with the normals of my geometries... Is there a way to > get the normals of a vertex array, as vectors? > > An if not, how to achieve this simple effect, of a two-sided geometry with > different images on each side?... :? > > Thank you! > > Cheers, > Ku > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=30428#30428 > > > > > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

