Show
Ignore:
Timestamp:
07/30/10 21:39:38 (4 years ago)
Author:
robert
Message:

Beginning of crease angle support for SmoothingVisitor? to all it duplicate vertices are creases
thus enabling separate normals for triangles adjacent to the creases.

Files:
1 modified

Legend:

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

    r11685 r11688  
    393393    OSG_NOTICE<<"Read font "<<fontFile<<" font="<<font.get()<<std::endl; 
    394394 
    395     bool useTessellator = false; 
     395    bool useTessellator = true; 
    396396    while(arguments.read("-t") || arguments.read("--tessellate")) { useTessellator = true; } 
     397    while(arguments.read("--no-tessellate")) { useTessellator = false; } 
    397398 
    398399    float thickness = 5.0; 
    399400    while(arguments.read("--thickness",thickness)) {} 
     401 
     402    float creaseAngle = 10.0f; 
     403    while(arguments.read("--crease-angle",creaseAngle)) {} 
     404 
     405    OSG_NOTICE<<"creaseAngle="<<creaseAngle<<std::endl; 
    400406 
    401407    osg::ref_ptr<osg::Group> group = new osg::Group; 
     
    433439            geode->addDrawable(bevel); 
    434440            osgUtil::SmoothingVisitor smoother; 
    435             smoother.smooth(*bevel); 
     441            smoother.setCreaseAngle(osg::DegreesToRadians(creaseAngle)); 
     442            geode->accept(smoother); 
    436443        } 
    437444