Thanks for the advice!
I'm getting closer but not quite there yet.
I found that my drawable in this test case has exactly one parent, and his
parent has a state set. I am able to get the image attached to the texture on
this state set without running across any null pointers, and write the image to
a file for verification...
Code:
if(drawable->getParent(0)->getStateSet())
{
state_set = drawable->getParent(0)->getStateSet();
osg::Texture * texture = state_set->getTextureAttribute(0,
osg::StateAttribute::TEXTURE)->asTexture();
if(texture->getImage(osg::Material::FRONT))
{
textureImage = texture->getImage(osg::Material::FRONT);
osgDB::writeImageFile(*textureImage, "image.bmp");
}
Unfortunately, the image produced is pure noise. Also, I've found that using
the getColor method on the image always returns a Vec4 with values (1, 1, 1,
1)... so something is clearly wrong.
I should have no problem accessing the textures of an *.ive file directly in
this way, right?
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=50379#50379
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org