I assume your "geom" variable is actually an osg::Geode... Did you supply texture coordinates for your geometry? (For example, osg::Geometry::setTexCoordArray)
Did you look at the Texture2D example to see how it is different from your code? Whenever I want to do something in OSG and don't know how, and it's something basic like texture mapping, I usually look at one of the examples to figure out what I've done wrong. -Paul > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Sascha Kuhn > Sent: Saturday, January 20, 2007 2:15 PM > To: osg users; osg-users@openscenegraph.net > Subject: [osg-users] Creating a image with an array > > I have an array of integer variables as picture that should > be showed on the geometry. On the code below is the datatext > the pointer to my array. But I don't see anything on the > Geometry (only the color of my geom) if I run the code below. > > Can anybody help me what I have to complement on my code that > I can see my texture on the geom. > > Thanks > > Sascha > > osg::Image* image=new osg::Image; > > image->setImage(size_grid,size_grid,1,GL_RGBA8,GL_RGB,GL_SHORT ,datatext, > image->osg::Image::USE_NEW_DELETE); > > if (image) > > { > > osg::Texture2D* texture = new osg::Texture2D; > > texture->setImage(image); > > stateset->setTextureAttributeAndModes(0,texture,osg::StateAttr ibute::ON) > stateset->; > > } > > geom->Setstateset(stateset); > > > > _______________________________________________ osg-users mailing list osg-users@openscenegraph.net http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/