Hi,
How can i get a texture to be displayed always facing the screen? the width of
the texture has to be the width of the screen, same for height. and the corner
of the texture always start at screen coords 0,0
osg::StateSet* stateset = new osg::StateSet();
osg::Image* image =
osgDB::readImageFile("Images/panelForeground.png");
if (image)
{
image->setPixelFormat(GL_BGRA);
osg::Texture2D* texture = new osg::Texture2D;
texture->setImage(image);
texture->setWrap(osg::Texture2D::WRAP_S,
osg::Texture2D::REPEAT);
texture->setWrap(osg::Texture2D::WRAP_T,
osg::Texture2D::REPEAT);
stateset->setTextureAttributeAndModes(0,texture,osg::StateAttribute::ON);
stateset->setMode(GL_LIGHTING,osg::StateAttribute::ON);
stateset->setMode(GL_DEPTH_TEST,osg::StateAttribute::ON);
foregroundGeometry->setStateSet( stateset );
}
...
Thank you!
Cheers,
PaulG
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=12801#12801
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org