News for hackers. Stuff that matters.
Re:Ask HN: What HN post made you money? by ggambetta on Thursday August 04, 2022 @10:27AM (#32343354)
This one: https://news.ycombinator.com/item?id=19584921 And it wasn't even my post!

A long time ago I found myself teaching Computer Graphics at my alma mater. Over the following years my approach to the subject evolved, and I really got the hang of it. After I stopped teaching, I took my notes, handouts and slides, and made them into a series of articles that I put on my website, where they remained in relative obscurity. Hacker News managed to find it every once in a while, and it was generally well received, but nothing came out of this. Until April 2019, when that post made the HN front page again, except this time it caught the attention of an editor in No Starch Press.

Long story short, my materials are now a book, Computer Graphics from Scratch, sold by No Starch Press [0], and also available for free on my website [1].

This genuinely wouldn’t have happened without your support. THANK YOU, HN community :)

[0] https://nostarch.com/computer-graphics-scratch

[1] http://gabrielgambetta.com/computer-graphics-from-scratch

Re:Ask HN: What HN post made you money? by bob1029 on Thursday August 04, 2022 @10:40AM (#32343515)
I've got your book sitting on my coffee table right now.

My primary reason for picking it up was to get my head around writing a triangle rasterizer from scratch. I found it to be a really good reference that addresses some of the nastier things like clipping, which most other tutorials happily omit.

At some point, I will probably end up writing my own book about all of this as well. I don't know that any 2 people can ever have the same trip through this jungle.

Re:Ask HN: What HN post made you money? by ggambetta on Thursday August 04, 2022 @10:45AM (#32343579)
The more, the merrier! Everyone understands and explains things in their own unique way, so there's no perfect book for everyone - but each book might be a perfect fit for someone!
Re:Ask HN: What HN post made you money? by drivers99 on Saturday August 06, 2022 @10:40AM (#32368507)
I ran out to Barnes & Noble and bought your book right after seeing your post and seeing one nearby that had it in stock. (Amazon was going to take a couple weeks to send it. Actually some other company was the sender. Weird. Also I didn’t notice you had it online but I like having the book and paying you anyway. :) )

So I picked up the book Thursday and finished the basic ray tracer Friday :) Not counting chapter 5 of course so there’s a lot more that I can add from here but it’s made me interested in multi-processing to make it faster, (mine is in unoptimized Python currently, using pygame to have a canvas/window and calling it for each pixel), maybe using GPU shaders to do it (never used those before), and learning about techniques other people are using[1][2] (from YouTube etc), and going down the rabbit hole of old CGI animations from the last 50 years[3].

Looking forward to the second half of the book this weekend. I have written a basic renderer before. I did an independent study class in college and I wrote a stereoscopic one for the iGlasses VR headset[4] in the 90s (you just have to draw using two cameras and interlace the images).

[1] https://youtu.be/A61S_2swwAc “NamePointer - I made a better ray-tracing engine”

[2] https://excamera.com/sphinx/article-ray.html “A reasonably speedy Python ray-tracer”

[3] https://youtu.be/WV4qXzM641o “The Compleat Angler (1978)” Ray tracing animation with refraction, rippling water, etc. from 1978!

[4] https://youtu.be/NoVMIVY5tPA “Virtual I/O iGlasses”

Re:Ask HN: What HN post made you money? by drivers99 on Saturday August 06, 2022 @07:31PM (#32372546)
By the way the vertices of the cube on page 109 ("Projecting our first 3D Object") appear to be wrong. I checked your example code online and got the correct vertices. Didn't see that listed as an errata so thought I'd let you know, if you see this.

Basically the cube just needed to be manually moved back and to the left to look like the example screenshot. As it is in the book, it's too close to the viewport and so it's not visible.

(BTW, for fun, I also animated it flying left and right and forward and back on a sine/cosine wave. Pretty fun!)

Re:Ask HN: What HN post made you money? by ggambetta on Sunday August 07, 2022 @07:26AM (#32375642)
Thanks for bringing this up. I had fixed this on the website version [0] as well as the code, as you mention. I thought I had reported this to NSP, but can't find an email, so I'll let them know so they can add it to the errata.

[0] https://gabrielgambetta.com/computer-graphics-from-scratch/0...

Re:Ask HN: What HN post made you money? by fermentation on Thursday August 04, 2022 @11:07AM (#32343899)
I just wanted to say that I LOVE this book. It did a much better job of explaining how to render things than my graphics class back in college did, and in a much shorter timeframe.
Re:Ask HN: What HN post made you money? by ggambetta on Thursday August 04, 2022 @12:10PM (#32344755)
Thank you! Happy to hear it's been helpful :)
Re:Ask HN: What HN post made you money? by btkthrowaway1 on Friday August 05, 2022 @02:14PM (#32359796)
There's an intro bit you have on color and how it behaves in additive vs subtractive mediums. To this day, I feel like it was one of the most concise and well explained overviews I've ever read.

I still plan on working through your book "eventually", but I just wanted to thank you for that first bit.

Re:Ask HN: What HN post made you money? by f0e4c2f7 on Thursday August 04, 2022 @01:04PM (#32345492)
Wow this is so cool - I haven't read your book but I probably will after seeing this comment. Keep making cool stuff!
Re:Ask HN: What HN post made you money? by ggambetta on Friday August 05, 2022 @03:45AM (#32352961)
Thanks! Let me know what you think :)