惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Fortinet All Blogs
Attack and Defense Labs
Attack and Defense Labs
V2EX - 技术
V2EX - 技术
O
OpenAI News
S
Secure Thoughts
H
Heimdal Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Schneier on Security
Schneier on Security
H
Hacker News: Front Page
S
Security Affairs
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
The Register - Security
The Register - Security
GbyAI
GbyAI
Cloudbric
Cloudbric
MongoDB | Blog
MongoDB | Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
K
Kaspersky official blog
Forbes - Security
Forbes - Security
Y
Y Combinator Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
Scott Helme
Scott Helme
Hacker News - Newest:
Hacker News - Newest: "LLM"
The Cloudflare Blog
Recorded Future
Recorded Future
人人都是产品经理
人人都是产品经理
Cyberwarzone
Cyberwarzone
C
CERT Recently Published Vulnerability Notes
Webroot Blog
Webroot Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LangChain Blog
T
Tor Project blog
Microsoft Azure Blog
Microsoft Azure Blog
博客园_首页
Hacker News: Ask HN
Hacker News: Ask HN
Blog — PlanetScale
Blog — PlanetScale
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog RSS Feed
N
News and Events Feed by Topic
阮一峰的网络日志
阮一峰的网络日志
I
Intezer
V
V2EX
T
Tailwind CSS Blog
SecWiki News
SecWiki News
NISL@THU
NISL@THU
C
Check Point Blog

博客园 - 悠然小调

nothing.... 博文阅读密码验证 - 博客园 最简单的智能指针原理 模板的特化 计算基类虚表指针在派生类中的偏移量 写一个内存拷贝函数 [转]来自 COM 经验的八个教训 COM本质论学习笔记(一)IDL winsock中select的作用 windows核心编程学习笔记(三)线程池(Thread Pooling) windows核心编程学习笔记(八)结构化异常处理(Structured Exception Handling) [转]亲密接触VC6.0编译器 windows核心编程学习笔记(七)DLL Injection and API Hooking windows核心编程学习笔记(五.续)堆 windows核心编程学习笔记(五)内存映射文件 windows核心编程学习笔记(四)windows内存结构/虚拟内存/线程的堆栈 windows核心编程学习笔记(二)Wait For Kernel Object(s) windows核心编程学习笔记(一)使用Critical Section [转]筛选法求素数
Ogre中在SceneNode节点旁显示二维字的代码
悠然小调 · 2008-08-12 · via 博客园 - 悠然小调

    在Ogre官方网站的wiki上有一个MovableText类:http://www.ogre3d.org/wiki/index.php/MovableText
    它可以用来在SceneNode旁显示二维字,使用时只要构造一个MovableText对象,然后将其挂在SceneNode下就可以了。其实我们可以用它显示各种二维字,包括像Overlay一样的东西。在我们的工程中,我们用它来显示飞行模拟器各仪表上的二维文字。

   一、 这里给的是我对MovableText的一个改进版,主要增加两项功能:
    1.可以使文字反色(或者说是高亮)
                 
      通过给material增加一个pass,然后进行混合来实现:

   

    2.设置文字与SceneNode的相对位置。
       在写字时通过位置偏移计算三角形顶点坐标实现。

    二、这个类使用方法很简单:

1{
2m_Text = new MovableText("Title","OGRE" ,"BlueHighway"5, ColourValue::Green);
3m_Text->setRelativePos(-103);
4m_Text->setTextAlignment(MovableText::H_CENTER, MovableText::V_BELOW);
5m_MonsterSceneNode->attachObject(m_Text);
6}

    在需要高亮显示时调用:

m_Text->reverseColor();

 

    代码在 这里 下载

--ArenAK--