I'd suggest looking in the StateSets of Nodes, not just Drawables.
   -Paul


On 4/27/2011 10:43 PM, ChiaYuan wrote:
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


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




--
  -Paul Martz      Skew Matrix Software
                   http://www.skew-matrix.com/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to