Show
Ignore:
Timestamp:
07/03/08 17:49:28 (6 years ago)
Author:
robert
Message:

Added new data structure + build algorithm that places triangles into leaves
without being shared, but with varying the boundaries of leaves so that they
may overlap.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgkdtree/osgkdtree.cpp

    r8528 r8532  
    3939 
    4040#include "fixeddivision.h" 
     41#include "variabledivision.h" 
    4142 
    4243 
     
    9091    else 
    9192    { 
     93        variabledivision::KDTreeBuilder builder; 
     94 
     95        builder._maxNumLevels = maxNumLevels; 
     96        builder._targetNumTrianglesPerLeaf = targetNumIndicesPerLeaf; 
     97        builder._processTriangles = processTriangles; 
     98 
     99 
     100        osg::Timer_t start = osg::Timer::instance()->tick(); 
     101 
     102 
     103        scene->accept(builder); 
     104 
     105        osg::Timer_t end = osg::Timer::instance()->tick(); 
     106        double time = osg::Timer::instance()->delta_s(start,end); 
     107        osg::notify(osg::NOTICE)<<"Time to build "<<time*1000.0<<"ms "<<builder._numVerticesProcessed<<std::endl; 
     108        osg::notify(osg::NOTICE)<<"build speed "<<(double(builder._numVerticesProcessed)/time)/1000000.0<<"M vertices per second"<<std::endl; 
    92109    }     
    93110