- 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.
- Mastering JavaScript Object-Oriented Programming
- Python入門很簡單
- Learning Chef
- Learning AWS Lumberyard Game Development
- Learn Programming in Python with Cody Jackson
- 精通網絡視頻核心開發技術
- Mathematica Data Analysis
- Oracle Exadata專家手冊
- Java:High-Performance Apps with Java 9
- Linux:Embedded Development
- Instant Nancy Web Development
- Python Data Structures and Algorithms
- OpenCV 4計算機視覺項目實戰(原書第2版)
- Android開發三劍客:UML、模式與測試
- Java程序設計基礎(第6版)