Advertisement
Guest User

Untitled

a guest
Feb 1st, 2018
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. #include <osg/Notify>
  2. #include <osgText/Text>
  3.  
  4. int
  5. main(int argc, char** argv)
  6. {
  7.     osg::BoundingBox bbox;
  8.  
  9.     osgText::Text* text = new osgText::Text();
  10.     text->setText("Hello, world.");
  11.  
  12.     text->setShaderTechnique(osgText::GREYSCALE);
  13.     bbox = text->getBoundingBox();  
  14.     OSG_NOTICE << "GREYSCALE, bbox width = " << (bbox.xMax() - bbox.xMin()) << ", height = " << (bbox.yMax() - bbox.yMin()) << std::endl;
  15.  
  16.     text->setShaderTechnique(osgText::SIGNED_DISTANCE_FIELD);
  17.     bbox = text->getBoundingBox();  
  18.     OSG_NOTICE << "SDF, bbox width = " << (bbox.xMax() - bbox.xMin()) << ", height = " << (bbox.yMax() - bbox.yMin()) << std::endl;
  19.  
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement