Hi all....

I'm working in a osg::NodeVisitor to see TerrainTiles that are Currently 
Active, Which I thought were the visible tiles... when I zoom in to the DB and 
look at hi rez tiles, then zoom out again to see lo rez tiles, the tile 
printout information always the highest level for that location.. and while I 
can see the mesh in the window is a low res tile, or page or cell etc... my 
printout always shows the highest LOD data.


Here is the code

   virtual void apply(osgTerrain::TerrainTile& tile)
   {
          osgTerrain::TerrainTile* TT = 
dynamic_cast<osgTerrain::TerrainTile*>(&tile);
          osgTerrain::TileID tid = tile.getTileID();
          for (int i=0;i< tid.level; i++)
            std::cout << " | ";
          std::cout << " Tile X  "<< tid.x  << " Tile Y "<< tid.y << " Tile 
level " << tid.level << std::endl;
    }

    virtual void apply(osg::Group& group)
    {
      static int depth = 0;
          std::cout<<" " << depth << " "<< &group  << "G "<< group.className() 
<<" has " <<group.getNumChildren()<< "C" << std::endl;

         // distinguish a tile from other groups
         osgTerrain::TerrainTile* tile = 
dynamic_cast<osgTerrain::TerrainTile*>(&group);
          if (tile)
          {
            apply(*tile);
          }
          else
          {
            depth++;
            traverse(group);
            depth--;
          }
     }



... 

Thank you!

Cheers,
lawrence

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





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

Reply via email to