[HN Gopher] One Formula That Demystifies 3D Graphics
___________________________________________________________________
One Formula That Demystifies 3D Graphics
Author : msephton
Score : 74 points
Date : 2025-12-31 16:10 UTC (4 days ago)
(HTM) web link (www.youtube.com)
(TXT) w3m dump (www.youtube.com)
| smokel wrote:
| The formula is f(x, y, z) = [x/z, y/z], which does perspective
| projection of a 3D coordinate onto a 2D plane.
|
| I can't really say that this _formula_ demystifies things, but
| the video is nice if you 're eager to learn about this.
| d-lisp wrote:
| To me the formula mystifies things. It should be made clear
| that it is a simple application of pythagore's theorem,
|
| (i didn't see the video except the beginning to check what was
| the "mysterious formula".)
| msephton wrote:
| He does get to that after the foreplay.
| olivergregory wrote:
| Don't you mean Thales?
| d-lisp wrote:
| Yes !!
| sebular wrote:
| The way he animated points with an increasing z value made it
| click for me. Now, when I look at the formula it makes sense.
| The larger the value of z, the smaller your projected x and y
| will be. This checks out because things get smaller as they
| move farther away. Something that's twice as far away will seem
| half as big.
|
| The rotation formula eludes me.
| smokel wrote:
| _> The rotation formula eludes me._
|
| Interestingly, in a way, rotation is less mystical than the
| perspective projection. The rotation is linear: x' = Rx, but
| the perspective projection is non-linear.
|
| This is where things become fun. Next up are _homogeneous
| coordinates_ or _quaternions_. Takes a few years of your life
| to actually enjoy this though :)
| corysama wrote:
| I recently appreciated this vid explaining that 3D
| translation using the traditional 4x4 transform matrix is
| performing a shear operation in 4D.
|
| https://youtu.be/x1F4eFN_cos
| chuckadams wrote:
| I get how quaternions beat Euler angles, but I still can't
| visualize the damn things 8-/
| aleph_minus_one wrote:
| > I get how quaternions beat Euler angles, but I still
| can't visualize the damn things 8-/
|
| And spin groups beat quaternions since they work in
| _every_ (finite) dimension. :-)
| storus wrote:
| This formula also leads to weird geometric perceptual
| distortions like when one stands in front of a tall building,
| looks up and down and the shape of the building changes
| depending on the angle of the view. VR got rid of that.
| ndepoel wrote:
| The real "a-ha" demystifying moment for me was not so much
| learning about the elementary rotation, translation or even
| perspective projection operations. It was understanding how all
| of those operations can be composed together into a single
| _transformation_ and that all that 3D graphics really is, is
| transforming coordinates from one relative space to another.
|
| One important revelation in that regard for instance, was that
| moving a camera within a world is mathematically exactly the
| same as moving the world in the opposite direction relative to
| the camera. Once you get a feel for how transformations and
| coordinate spaces work, you can start playing around with them
| and a whole new world of possibilities opens up to you.
| rabf wrote:
| I've always walked to the shops by pulling the earth around
| beneath my feet!
| fifilura wrote:
| Once, an angry guy tried to explain that the world does not
| revolve around me.
|
| I had to walk him away.
| diabllicseagull wrote:
| if you are a little bit familiar with graphics you go: duh,
| things appear smaller with increasing distance. if you are not
| tho, it's a great intro to perspective projection. I love how
| accessibly educative his videos are.
| macintux wrote:
| I always found it odd that perspective had to be "discovered"
| by artists, but a little digging online turned up this
| interesting, detailed look at its history.
|
| https://www.essentialvermeer.com/technique/perspective/histo...
| smokel wrote:
| Artists are _still_ struggling with the fact that human
| perception arises from binocular vision. Two distinct retinal
| inputs are integrated by distributed neural processes into a
| single, coherent 3D experience. This integration is neither a
| simple planar stitching nor a direct representation of the
| world, but an active construction shaped by neural
| computation and subjective awareness.
|
| It is quite likely that artists in earlier periods struggled
| with this as well, and were less concerned with adhering
| strictly to a photographic or geometrically exact
| perspective, as we are. The adoption of the camera obscura
| probably influenced things a lot.
| Demiurge wrote:
| Is "neural computation" a thing, or a poetic metaphor?
| smokel wrote:
| It's a thing [1].
|
| [1] https://en.wikipedia.org/wiki/Neural_computation
| fenwick67 wrote:
| Even ignoring binocular vision it's very unintuitive to
| "draw what you see" because of this. Our brain usually
| interprets our environment as objects, 3d shapes, and
| things. Turning that off and trying to grab a literal image
| from it is difficult
| gmiller123456 wrote:
| It's a lot less about being discovered, or invented, and a
| lot more about the idea of using it at all. The Renaissance
| was a massive change in culture. Before that, art was a tool
| used in rituals or storytelling rather than something to be
| enjoyed on its own. There was more emphasis on reproducing
| things as they actually were than how they looked from a
| particular vantage point.
| 0xfaded wrote:
| The world of homogeneous coordinates
| (https://en.wikipedia.org/wiki/Homogeneous_coordinates) is
| magical and extends beyond just points and lines to conics.
|
| The Multiview Geometry Book begins with a great deep dive on the
| topic.
|
| https://www.cambridge.org/us/universitypress/subjects/comput...
| boslo-km wrote:
| Jim Blinn's Corner (1996) also has a good chapter/article, "The
| Homogenous Perspective Transform."
| dustbunny wrote:
| I've been watching a ton of Tsoding lately. I really like nob.h
| his build system and I've been using it in my projects. Why we
| ever used a different language to build C/C++ seems so insane.
| Using the same language for the build system is just far simpler
| rabf wrote:
| His application `boomer` is the best desktop zoom app for X11!
| Bound to a keyboard shortcut its very useful for debugging
| graphics layout errors during development.
___________________________________________________________________
(page generated 2026-01-04 23:01 UTC)