[osg-users] Cannot get texture map from loaded .flt file

ChiaYuan lancy0511 at gmail.com
Wed Apr 27 21:43:20 PDT 2011


Hi,

I have tried to get the texture map from the loaded .flt file but it returned null.

I have looked up the thread here

Code:
osg::Group* Ground = dynamic_cast<osg::Group*> 
                
(osgDB::readNodeFile("C:/Program/Multigen-Paradigm/creator_3_2/tutorials/DesktopTutor/Models/arena.flt"));

I use a node visitor to find all geodes in the scenegraph "Ground" and the 
apply function looks like this:

        for (unsigned int i=0; i<currentGeode.getNumDrawables(); ++i)
        {
                osg::StateSet* StateSet = 
(currentGeode.getDrawable(i))->getStateSet();
                osg::Texture* Texture = dynamic_cast<osg::Texture*> 
(StateSet->getTextureAttribute(0, osg::StateAttribute::TEXTURE));

                --- modify the texture ---
        }
l



It said use the option 
> preserveFace
 can get the texture. But I still cannot get any info from the model.

Is there any one can get texture from .flt without any problem?

I have also attached the flt file and let others try to get the texture.
Thanks

Cheers,
ChiaYuan

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




Attachments: 
http://forum.openscenegraph.org//files/capecodflight_558.zip





More information about the osg-users mailing list