Hopefully this will come through this time - I had to signup my new work email to be able to send from here. Anyway, here's a snippet that should work, or at least give you something to go on:

#include <TXPNode.h> // from OpenSceneGraph/src/osgPlugins/txp

...

osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFile(filename);

txp::TXPNode* txpNode = dynamic_cast<txp::TXPNode*>(loadedModel.get());
if(txpNode)
{
    txp::TXPArchive* txpArchive = txpNode->getArchive();
    osg::BoundingBox extents;
    double xOrigin, yOrigin;
    txpArchive->getExtents(extents);
    txpArchive->getOrigin(xOrigin, yOrigin);

    // do something with the origin and extents
}


Other than that, scrounge around through the header files in osgPlugins/txp for more info, esp. TXPNode.h, TXPArchive.h, and trpage_geom.h (for the trpgHeader definition).

Don


Jason wrote:
Don,
If you could, yes please. I'm not too familiar with the TXPPlugin or the archive. I'm reading in the TXP just using osgDB::readNodeFile ... is there another way I should be reading in a terrapage or is this plugin applied automatically? Thanks,
Jason


--
"Democracy is two wolves and a lamb voting on what to have for lunch.
Liberty is a well-armed lamb contesting the vote."
                        - Benjamin Franklin

+----------------------------------------+
|  Don Tidrow                            |
|  Visualization Software Engineer       |
|  SAIC                                  |
|  ph: 703-253-1094                      |
+----------------------------------------+
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to