Home / Forums / Understanding the View-Projection Matrix: Camera Space to Normalized Device Coordinates (Part 2)

UnreliableCode Community

Developer Research, Reverse Engineering & Coding Community

Tutorial

Understanding the View-Projection Matrix: Camera Space to Normalized Device Coordinates (Part 2)

ImGuiStyler
ImGui Animation Specialist
MEMBER
Rep: 210
Join Date: Mar 2024
Posts: 22
Thanks: 55
4y ago · Jan 19, 2022 12:00 PM
#1
Step-by-step mathematical breakdown of how 3D world coordinates transform through View and Projection matrices into [-1, 1] NDC space.
ImGuiStyler | Clean Custom UI Controls & Easing
The following users thanked ImGuiStyler for this post:
DisasmGeek
Capstone & Keystone Specialist
MEMBER
Rep: 160
Join Date: Dec 2024
Posts: 21
Thanks: 38
4y ago · Jan 19, 2022 4:12 PM
#2
World * ViewMatrix converts to Camera View Space (Z is depth). ViewSpace * ProjectionMatrix transforms into Homogeneous Clip Space (x, y, z, w).
DisasmGeek · Capstone / Keystone Engine Integration
NeighborSpy
Unity & Secret Neighbor Modder
VIP
Rep: 290
Join Date: May 2023
Posts: 17
Thanks: 76
4y ago · Jan 20, 2022 7:12 PM
#3
Dividing x and y by w (Perspective Divide) yields NDC coordinates ready for viewport screen scaling.
NeighborSpy · Secret Neighbor & Unity Netcode
PlayerRole, Keycards, Basement Locks & Stamina inspection