osgText::Text osg字体
#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();
}


osgText::Text osg字体的更多相关文章
- 【OSG】osgText::Text 研究
由于需要在3D坐标轴上显示刻度值,所以要用到osgText::Text,这里简单记录一下其常见用法. 一.基本知识 常见设置 设置字体:setFont 设置内容:setText,这里输入参数需要是os ...
- osgText::Text简介
整理自<OpenSceneGraph三维渲染引擎编程指南> 在OSG中,为了显示高质量的文字,专门定义了一个新的名字空间来管理场景中的文字渲染,这个名字空间中的类主要用于加载字体和控制文字 ...
- 0312-css样式(选择器、文本text、字体fonts、背景background)
问题: 1.css中table{border:1px:}是定义table的样式,只有表格的外边框,不能实现<table border="1"></table> ...
- css文本样式text、字体样式font
文本样式text 1.文本颜色color 例如h1 {color:red;} 2.文本方向direction,不常用 默认ltr从左到右,rtl表示从右到左 3.文本水平对齐方式text-align ...
- 更换Sublime Text主题字体
Sublime Text作为脚本程序开发工具是一个不错的选择,支持多种语言,支持代码高亮显示,必要时还有代码提示功能.但是有的主题字体实在是难看,不过Sublime Text中也是可以更改的,只是更改 ...
- css 文本外观属性(text) 和 字体样式属性(font)
css文本 text外观属性 color: 颜色值(red,blue)十六进制 ,rgb letter-spacing: 字间距 px,em word-spacing: 单词间距 对中文无效 line ...
- CSS3总结三:文字(text)/字体、文本、文本装饰、多列
Text-Decoration text-shadow text-decoration Font font font-face Text 常用Text属性 Multi-column Multi-col ...
- 第4章 css文字text与字体font-face
text-overflow 与 word-wrap text-overflow:用来设置是否使用一个省略标记(...)标示对象内文本的溢出. 语法: 但是text-overflow只是用来说明文字溢出 ...
- sublime Text 3 字体
1,Comic Sans Ms 2,DejaVu Sans Mono 3,microsoft yahei(微软雅黑) 4,Microsoft Yahei UI(微软雅黑增强版) 5,Ubuntu Mo ...
随机推荐
- [Abp vNext微服务实践] - 框架分析
一.简介 abp vNext新框架的热度一直都很高,于是最近上手将vNext的微服务Demo做了一番研究.我的体验是,vNext的微服务架构确实比较成熟,但是十分难以上手,对于没有微服务开发经验的.n ...
- Luogu P3243 菜肴制作
Luogu P3243 菜肴制作 神神奇奇的拓扑排序,也就是借这道题学习一下大名鼎鼎的Toposort了-- #include<bits/stdc++.h> #define N 10001 ...
- 运维CMDB建设思路
在我们日常的运维工作中,面对着大量的基础设施和软件服务,该如何管理?这个管理的原则又是什么?粒度该如何控制?我们是否可以建立一个统一的标准模型来管理以上对象?管理过程中,如何降低人力成本?资源对象的生 ...
- 《AlwaysRun!团队》第四次作业:项目需求调研与分析
项目 内容 这个作业属于哪个课程 http://www.cnblogs.com/nwnu-daizh/ 这个作业的要求在哪里 https://www.cnblogs.com/nwnu-daiz ...
- vue2 父链,子组件索引及父子通信的props对象写法
- pygame无法自动补全解决方法
在pycharm中导入pygame 1. 如果出现 AttributeError: module 'pip' has no attribute 'main'问题 找到安装目录下 helpers/pa ...
- 使用jQuery快速高效制作网页交互特效---使用jQuery操作DOM
DOM操作分类 1.DOM Core:任何一种支持DOM的编程语言都可以使用它,如getElementById() 2:HTML-DOM:用于处理HTML文档,如document.forms 3:CS ...
- openssl使用以及C#加密和数字签名
如何使用openssl生成RSA公钥和私钥对 http://blog.csdn.net/scape1989/article/details/18959657 https://www.openssl ...
- c++学生信息管理系统(window控制台实现鼠标点击操作)
翻起大一时写过的作业代码--一个学生信息管理系统,当时不会使用QT,不会MFC等库,只会c++,但是又想做一个有界面的,能够实现鼠标操作的程序.于是绞尽脑汁查资料,自己造轮子,最终写出来了下面的这个现 ...
- 小象和老鼠 DP
小象和老鼠 DP \(N*M\)的网格图,格子\((i,j)\)有\(A_{i,j}\)个老鼠,问小象从左上角\((1,1)\)走到右下角\((N,M)\)看到的最少老鼠.小象可以看见老鼠,当且仅当老 ...