Menu

Divide by depth for instant 3D
📰
0

Divide by depth for instant 3D

Hacker News·about 10 hours ago
#B8ATiqdg
Reading 0:00
15s threshold

When I first started working on games, I used high level frameworks that would give you a Camera that just kind of worked. But as I learned more and wanted to apply more creative techniques, I struggled to even have the vocabulary to search for what I wanted to do, and only after writing lower level graphics code did I understand cameras are based around kind of really simple math. In the excellent One Formula That Demystifies 3D Graphics (via @tsoding ), we’re presented with the following: ( x , y , z ) x ' = x / z y ' = y / z In essence, if we say \(y\) is up and \(z\) is forward, 3D coordinates \((x, y, z)\) can be projected into 2D coordinates \((x', y')\) by dividing \(x\) and \(y\) by \(z\).…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More