#ifdef _WIN32
#include <Windows.h>
#endif // _WIN32
#include<iostream> #include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>
#include <osgViewer/CompositeViewer> #include <osgDB/ReadFile> #include <osg/Geode>
#include <osg/Node>
#include <osg/Geometry>
#include <osg/GraphicsContext>
#include <osg/ShapeDrawable>
#include <osg/Material>
#include <osg/Image>
#include <osg/Texture2D>
#include <osg/TexEnv>
#include <osg/TexGen>
#include <osg/NodeVisitor>
#include <osg/MatrixTransform>
#include <osg/PositionAttitudeTransform>
#include <osg/AnimationPath>
#include <osg/Matrixd>
#include <osg/PagedLOD>
#include <osg/Camera>
#include <osgText/Text> #include <osgGA/TrackballManipulator>
#include <osgGA/GUIEventHandler>
#include <osgGA/CameraManipulator>
#include <osgGA/StandardManipulator>
#include <osgGA/OrbitManipulator>
#include <osgGA/TrackballManipulator> #include <osgUtil/IntersectionVisitor>
#include <osgUtil/LineSegmentIntersector> osg::Camera* createTextHUD()
{
osg::ref_ptr<osg::Geode> geode1 = new osg::Geode;
osg::ref_ptr<osgText::Text> text1 = new osgText::Text;
osg::ref_ptr<osg::Camera> camera1 = new osg::Camera; camera1->setViewMatrix(osg::Matrix::identity());
camera1->setRenderOrder(osg::Camera::POST_RENDER);
camera1->setClearMask(GL_DEPTH_BUFFER_BIT); camera1->setAllowEventFocus(false);
camera1->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
camera1->setProjectionMatrixAsOrtho2D(-, , -, ); text1->setFont("Fonts/simhei.ttf");
text1->setCharacterSize();
text1->setText(L"OSG 中文字体");
text1->setPosition(osg::Vec3(0.0,0.0,0.0)); geode1->getOrCreateStateSet()->setMode(GL_LIGHTING,osg::StateAttribute::OFF);
geode1->addDrawable(text1); camera1->addChild(geode1.get());
return camera1.release();
} int main()
{
osg::ref_ptr<osgViewer::Viewer> viewer1 = new osgViewer::Viewer;
osg::ref_ptr<osg::Group> group1 = new osg::Group; //osg::ref_ptr<osg::Node> node1 = osgDB::readNodeFile("D:\\参考手册\\BIM\\osg\\build20190628.osgb");
osg::ref_ptr<osg::Node> node2 = osgDB::readNodeFile("D:\\参考手册\\BIM\\osg\\build1.osgb"); group1->addChild(node2.get());
group1->addChild(createTextHUD()); viewer1->setSceneData(group1.get());
viewer1->setUpViewInWindow(,,,,); viewer1->run();
}

最新文章

  1. 546C. Soldier and Cards
  2. windows下远程adb
  3. Java中实例方法,实例变量,静态方法,静态变量,final方法重写的问题,覆盖
  4. C语言程序设计第一次作业1
  5. 0513JS数组的定义、遍历、添加
  6. MIPCache 域名升级
  7. 机器学习方法、距离度量、K_Means
  8. 强联通分量-tarjan算法
  9. c++ 网络库
  10. IO流_文件切割与合并
  11. Android自定义布局的背景在多分辨率的情况下设置fill_parent时背景不能够横向全屏的问题解决
  12. 关于servlet3.0中的异步servlet
  13. hdu2602 Bone Collector(01背包) 2016-05-24 15:37 57人阅读 评论(0) 收藏
  14. 爱普生Me330 打印机改装连供系统计划
  15. SQL SERVER性能优化综述
  16. 【BZOJ1272】Gate Of Babylon [Lucas][组合数][逆元]
  17. Markov chain
  18. PXE刷机,存储节点失败
  19. jQuery Pagination分页插件--无刷新
  20. how-to-fix-fs-re-evaluating-native-module-sources-is-not-supported-graceful

热门文章

  1. Go语言的反射
  2. 2. kafka
  3. js事件冒泡/捕获
  4. AOP(execution表达式)
  5. sql server 存储过程 output 和return的使用 方法,详解
  6. 十八.搭建Nginx服务器、配置网页认证、基于域名的虚拟主机、ssl虚拟主机
  7. RabbitMQ消息队列+安装+工具介绍
  8. jsp中submit的连接属性是什么?
  9. linux 安装Apache服务器
  10. CSPS模拟94