- Hands-On C++ Game Animation Programming
- Gabor Szauer
- 186字
- 2021-06-30 14:46:00
Orthographic
An orthographic projection has no perspective to it. An orthographic projection maps linearly to NDC space. Orthographic projections are often used for two-dimensional games. It's often used to achieve an isometric perspective.
Implement the ortho function in mat4.cpp. Don't forget to add the function declaration to mat4.h:
mat4 ortho(float l, float r, float b, float t,
float n, float f) {
if (l == r || t == b || n == f) {
return mat4(); // Error
}
return mat4(
2.0f / (r - l), 0, 0, 0,
0, 2.0f / (t - b), 0, 0,
0, 0, -2.0f / (f - n), 0,
-((r+l)/(r-l)),-((t+b)/(t-b)),-((f+n)/(f-n)), 1
);
}
Orthographic view projections are generally useful for displaying UI or other two-dimensional elements.
- Learning LibGDX Game Development(Second Edition)
- Effective C#:改善C#代碼的50個有效方法(原書第3版)
- Leap Motion Development Essentials
- 基于Java技術的Web應用開發
- Java編程指南:基礎知識、類庫應用及案例設計
- Selenium Design Patterns and Best Practices
- Mastering Rust
- OpenShift在企業中的實踐:PaaS DevOps微服務(第2版)
- H5頁面設計:Mugeda版(微課版)
- Python編程:從入門到實踐
- Swift 4 Protocol-Oriented Programming(Third Edition)
- OpenStack Networking Essentials
- ASP.NET Web API Security Essentials
- jQuery技術內幕:深入解析jQuery架構設計與實現原理
- Python一行流:像專家一樣寫代碼