Hi,
Ok I will try to make it clearer.
I have a generated CubeMap, and I want to display each face on a quad with a
HUD Camera. I first tried to generate on face in a Texture2D and it worked
welll since I don't have to copy the image in the original texture in a new
texture (on the opposite if I try to use getIMage(), setImage(), this does not
work anymore) to display it on a quad.
For the CubeMap,Ii want its images (6) to be embedded in Texture2D to simply be
displayed on a quad.
Here is the piece of code :
//map contains the generated Cube map when the function is called
void SDDebugHUD::setTexture(osg::ref_ptr<osg::TextureCubeMap> map){
osg::StateSet* stateset = HUD_camera->getOrCreateStateSet();
osg::ref_ptr<osg::Texture2D> lm = new osg::Texture2D;
lm->setDataVariance(osg::Object::DYNAMIC);
lm->setImage(map->getImage(3));
stateset->setTextureAttributeAndModes( 0,lm);
}
Thank you!
Cheers,
Gaëtan
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=54506#54506
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org