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

推荐订阅源

J
Java Code Geeks
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
V
V2EX
小众软件
小众软件
WordPress大学
WordPress大学
Apple Machine Learning Research
Apple Machine Learning Research
Recent Announcements
Recent Announcements
有赞技术团队
有赞技术团队
MongoDB | Blog
MongoDB | Blog
C
Check Point Blog
S
Schneier on Security
C
Cybersecurity and Infrastructure Security Agency CISA
The Cloudflare Blog
V
Vulnerabilities – Threatpost
The Hacker News
The Hacker News
T
Threatpost
T
Tenable Blog
aimingoo的专栏
aimingoo的专栏
IT之家
IT之家
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
C
CERT Recently Published Vulnerability Notes
U
Unit 42
Spread Privacy
Spread Privacy
博客园 - 司徒正美
Hacker News: Ask HN
Hacker News: Ask HN
C
CXSECURITY Database RSS Feed - CXSecurity.com
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
阮一峰的网络日志
阮一峰的网络日志
SecWiki News
SecWiki News
云风的 BLOG
云风的 BLOG
The Register - Security
The Register - Security
AWS News Blog
AWS News Blog
月光博客
月光博客
Security Latest
Security Latest
H
Heimdal Security Blog
S
Secure Thoughts
博客园 - 聂微东
PCI Perspectives
PCI Perspectives
博客园 - 叶小钗
Scott Helme
Scott Helme
O
OpenAI News
Google DeepMind News
Google DeepMind News
Google DeepMind News
Google DeepMind News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
S
Security @ Cisco Blogs
NISL@THU
NISL@THU
S
Securelist
Latest news
Latest news
P
Proofpoint News Feed
博客园 - 【当耐特】

博客园 - Cloudage

测试:单、多帧自动拼块地图及视口卷动 测试了测试了,silverlight做游戏的可能性 IMH 这次的卡渲还算过得去 严重警告!关于D3D的渲染表面 今天开始研究Tiny 小改一下 这是一个关键……可是这个门槛我上不去了 恭贺本人加入KidFansChannel特别创作组 序列化 “应用程序LoaderLock”异常的引发和解决 漏图 玩家通过自主绘制法术阵来自定义法术的初步实现的思考 优化……优化…… Billboard的旋转以及让物体面向一个点的一种方法 卡通渲染原理 游戏系统的结构是怎样的? 同层物体间的遮挡处理
用Sprite做Billboard
Cloudage · 2006-08-22 · via 博客园 - Cloudage

以前由于不知道如何让Sprite进入投影空间,所以做Billboard都是用IndexBuffer,其实这种办法很笨拙,要做Billboard最好还是用Sprite。在Sprite.Begin的参数中选择Billboard,并且在呼叫之前调用SpriteSetWorldViewLH(或者RH)来传入World矩阵和View矩阵。World矩阵由期望的投影空间位置来构造,View矩阵来自摄影机。这样显示出来的Billboard有如下特点:

1、会进行投影变换(近大远小,这是当然的)

2、图像横方向沿X轴正向,纵方向沿Y轴正向。如果这个方向不对,则需要通过Sprite.Transform来设置一个旋转矩阵

3、图像的尺寸和投影空间比例相匹配。即如果源图像横有W个像素,纵有H个像素,则进入投影空间后Billboard的尺寸就是X=(float)W,Y=(float)H,Z=0。如果不需要这么大的尺寸,可以用过Sprite.Transform设置一个缩放矩阵

4、不进行背面剔除。因为这是Sprite。