Hi everyone. I'm experiencing an issue with texture images. I am using line segment intersectors in a manner similar to picking. With a couple of models, the texture retrieving algorithm works fine, however, with one model it fails. This is the extract of the code: Code:
osg::Drawable *collisionDrawable = intersection.drawable.get(); osg::StateSet *collisionStateSet = collisionDrawable ? collisionDrawable->getStateSet() : null; osg::Geometry *collisionGeometry = collisionDrawable ? collisionDrawable->asGeometry() : null; ... osg::Texture* texture = dynamic_cast<osg::Texture*> (collisionStateSet->getTextureAttribute(0, osg::StateAttribute::TEXTURE)); osg::Image *textureImage = texture ? texture->getImage(osg::Material::FRONT) : null; the textureImage equals to NULL after this sequence, while the texture does not. so why does the texture->getImage() method not return expected texture ? I checked the model, it seems to be all right. this is an example Code: ... Geode { ... num_drawables 1 Geometry { DataVariance STATIC StateSet { DataVariance STATIC ... textureUnit 0 { GL_TEXTURE_2D ON Texture2D { file ".\\textures\\102.jpg" wrap_s REPEAT wrap_t REPEAT wrap_r CLAMP min_filter LINEAR_MIPMAP_LINEAR mag_filter LINEAR maxAnisotropy 1 borderColor 0 0 0 0 borderWidth 0 useHardwareMipMapGeneration TRUE unRefImageDataAfterApply TRUE internalFormatMode USE_IMAGE_DATA_FORMAT resizeNonPowerOfTwo TRUE shadowComparison FALSE shadowCompareFunc GL_LEQUAL shadowTextureMode GL_LUMINANCE } TexEnv { UniqueID TexEnv_4 mode MODULATE } } } the other model, where it works, looks alike, when exported to osg format. so why is it, that for this model, the algorithm fails ? can anyone tell? Thank you very much, and i mean it, for anything useful! Cheers, Andrey ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47080#47080 _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org