Show
Ignore:
Timestamp:
04/19/11 11:53:34 (2 years ago)
Author:
robert
Message:

Cleaned up example

Files:
1 modified

Legend:

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

    r11800 r12289  
    387387    osg::Geode* geode  = new osg::Geode; 
    388388 
     389     
    389390//////////////////////////////////////////////////////////////////////////////////////////////////////// 
    390391//     
     
    393394 
    394395    float characterSize=radius*0.2f; 
    395      
     396 
     397 
    396398    osg::Vec3 pos(center.x()-radius*.5f,center.y()-radius*.5f,center.z()-radius*.5f); 
    397399 
     
    420422    geode->addDrawable(text3); 
    421423 
     424    osg::Vec4 characterSizeModeColor(1.0f,0.0f,0.5f,1.0f); 
    422425 
    423426    osgText::Text* text4 = new osgText::Text; 
     
    427430    text4->setAxisAlignment(osgText::Text::SCREEN); 
    428431 
    429     osg::Vec4 characterSizeModeColor(1.0f,0.0f,0.5f,1.0f); 
     432    // reproduce outline bounding box compute problem with backdrop on. 
     433    text4->setBackdropType(osgText::Text::OUTLINE); 
     434    text4->setDrawMode(osgText::Text::TEXT | osgText::Text::BOUNDINGBOX); 
     435 
     436    text4->setText("SCREEN"); 
     437    geode->addDrawable(text4); 
    430438 
    431439    osgText::Text* text5 = new osgText::Text; 
     
    437445    text5->setAxisAlignment(osgText::Text::SCREEN); 
    438446    text5->setCharacterSizeMode(osgText::Text::SCREEN_COORDS); 
     447    text5->setDrawMode(osgText::Text::TEXT | osgText::Text::BOUNDINGBOX); 
    439448    text5->setText("CharacterSizeMode SCREEN_COORDS(size 32.0)"); 
    440449    geode->addDrawable(text5); 
     
    460469    geode->addDrawable(text7); 
    461470 
    462 #if 1 
    463     // reproduce outline bounding box compute problem with backdrop on. 
    464     text4->setBackdropType(osgText::Text::OUTLINE); 
    465     text4->setDrawMode(osgText::Text::TEXT | osgText::Text::BOUNDINGBOX); 
    466 #endif 
    467  
    468     text4->setText("SCREEN"); 
    469     geode->addDrawable(text4); 
     471 
    470472 
    471473    osg::ShapeDrawable* shape = new osg::ShapeDrawable(new osg::Sphere(center,characterSize*0.2f)); 
     
    679681        // make sure the root node is group so we can add extra nodes to it. 
    680682        osg::Group* group = new osg::Group; 
    681          
     683 
     684        if (true) 
    682685        { 
    683686            // create the hud. 
     
    693696        } 
    694697 
    695         group->addChild(create3DText(center,radius)); 
     698        if (true) 
     699        { 
     700            group->addChild(create3DText(center,radius)); 
     701        } 
    696702 
    697703        // set the scene to render