News for hackers. Stuff that matters.
Re:One Formula That Demystifies 3D Graphics by smokel on Sunday January 04, 2026 @10:53AM (#46489095)
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.

Re:One Formula That Demystifies 3D Graphics by d-lisp on Sunday January 04, 2026 @12:29PM (#46490116)
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".)

Re:One Formula That Demystifies 3D Graphics by olivergregory on Sunday January 04, 2026 @03:09PM (#46491679)
Don't you mean Thales?
Re:One Formula That Demystifies 3D Graphics by d-lisp on Sunday January 04, 2026 @04:48PM (#46492635)
Yes !!
Re:One Formula That Demystifies 3D Graphics by msephton on Sunday January 04, 2026 @02:21PM (#46491216)
He does get to that after the foreplay.
Re:One Formula That Demystifies 3D Graphics by sebular on Sunday January 04, 2026 @12:41PM (#46490235)
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.

Re:One Formula That Demystifies 3D Graphics by smokel on Sunday January 04, 2026 @01:30PM (#46490748)
> 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 :)

Re:One Formula That Demystifies 3D Graphics by chuckadams on Sunday January 04, 2026 @02:40PM (#46491427)
I get how quaternions beat Euler angles, but I still can't visualize the damn things 8-/
Re:One Formula That Demystifies 3D Graphics by aleph_minus_one on Sunday January 04, 2026 @03:12PM (#46491706)
> 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. :-)

Re:One Formula That Demystifies 3D Graphics by corysama on Sunday January 04, 2026 @01:37PM (#46490819)
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

Re:One Formula That Demystifies 3D Graphics by storus on Sunday January 04, 2026 @12:43PM (#46490250)
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.
Re:One Formula That Demystifies 3D Graphics by ndepoel on Sunday January 04, 2026 @02:31PM (#46491325)
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.

Re:One Formula That Demystifies 3D Graphics by rabf on Sunday January 04, 2026 @03:23PM (#46491804)
I've always walked to the shops by pulling the earth around beneath my feet!
Re:One Formula That Demystifies 3D Graphics by fifilura on Sunday January 04, 2026 @03:54PM (#46492084)
Once, an angry guy tried to explain that the world does not revolve around me.

I had to walk him away.

Re:One Formula That Demystifies 3D Graphics by Terr_ on Monday January 05, 2026 @05:29AM (#46497200)
Though in the real-world case, there's an important difference that breaks the symmetry: You experience acceleration, whereas everybody else standing around you doesn't.