Hello,

I have a large terrain map which I load from an *.osg file containing a list of 
ProxyNode objects containing *.ive files, using osgDB::readNodeFile.

My end goal is to get RGB of points on the texture map found through a line 
segment intersection.

I have read through the mousePosition function in the InteractiveImageHandler 
class which shows how I would get the texture coordinates of the point 
intersected. 

>From there, I attempted to get the RGB value this way:


Code:

osg::Drawable * drawable = intersection.drawable.get();
if(drawable->getStateSet())
    {
        state_set = drawable->getStateSet();
        osg::Texture * texture =
            dynamic_cast<osg::Texture*>(state_set->getTextureAttribute
                                        (0, osg::StateAttribute::TEXTURE));

        if(texture)
        {
            textureImage = texture->getImage(osg::Material::FRONT);
            return textureImage->getColor(textureCoordinates);
        }
}




This snippet produces a valid drawable, however the drawable returns a NULL 
stateset and so I can't obtain the texture object.

How can I obtain the osg::Image to get RGB in this case? Or, is there a better 
method?

Thanks-

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=50366#50366





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to