Live data from Hacker News

Scratchapixel: Computer Graphics Programming from Scratch

scratchapixel.com

1–10 of 73 posts

Re: Scratchapixel: Computer Graphics Programming from Scratch

#2
Maybe I missed it, but I didn't see any discussion of the Bresenham family of algorithms. I realize this is always done for you nowadays, but if you're really teaching pixels from scratch, it seems like drawing lines and circles from raw pixels needs to be covered.

Re: Scratchapixel: Computer Graphics Programming from Scratch

#3

Maybe I missed it, but I didn't see any discussion of the Bresenham family of algorithms. I realize this is always done for you nowadays, but if you're really teaching pixels from scratch, it seems like drawing lines and circles from raw pixels needs to be covered.

The site focuses on raytracing, so it's all about 3D algorithms.

Re: Scratchapixel: Computer Graphics Programming from Scratch

#4
post #3

Maybe I missed it, but I didn't see any discussion of the Bresenham family of algorithms. I realize this is always done for you nowadays, but if you're really teaching pixels from scratch, it seems like drawing lines and circles from raw pixels needs to be covered.

The site focuses on raytracing, so it's all about 3D algorithms.

Fair enough.

Re: Scratchapixel: Computer Graphics Programming from Scratch

#5
post #3

Earlier quoted context omitted.

The site focuses on raytracing, so it's all about 3D algorithms.

Fair enough.

99% of the computer graphics you see on your screen everyday are made of simple lines, circles, curves, and text in 2D. 3D is useful mostly for games, movies, and CAD software. I don't understand this over focus on 3D. I think the latest edition of "Computer Graphics: principles and practice" does not even teach bresenham anymore. This seems wrong to me.

Re: Scratchapixel: Computer Graphics Programming from Scratch

#6
What I don't get is why nearly all resources on 3D graphics assume the reader is familiar with matrices and linear algebra. For those who don't speak that language, what you're doing is plotting numbers into a magic box, doing a magic multiply, and hey presto, we got 3D! Magic.

Meanwhile a teenager could easily get an intuitive grasp of 3D graphics if you just explained how translation is nothing besides addition, and that to rotate, you just use good old trig functions to generate rotated basis vectors along which to plot your vertices (really easy to show with images and animations too). And that magic perspective, to make things get smaller as they get further from the camera, is just one divide by the depth away... yes, all very basic arithmetic. And no need for magic such as homogeneous coordinates. They're just a convenience for when you do things a certain way.

You don't need to go to college or even high school for 3D rasterization. But most if not all texts pretty much want to assume such a background?

Actually, I'm quite tempted to try write such a tutorial for the 12-year-old me. Too bad I can't travel back in time to see if I'd actually understand it (but I have a strong feeling I could come up with something good enough). Yeah, the lack of approachable material was very frustrating for me back then. In the end I wrote a very primitive renderer (with plenty of trigonometry per vertex) which was way too slow and complicated to be useful. Because I didn't realize how simple the problem actually is.

Re: Scratchapixel: Computer Graphics Programming from Scratch

#8
post #6

What I don't get is why nearly all resources on 3D graphics assume the reader is familiar with matrices and linear algebra. For those who don't speak that language, what you're doing is plotting numbers into a magic box, doing a magic multiply, and hey presto, we got 3D! Magic. Meanwhile a teenager could easily get an intuitive grasp of 3D graphics if you just explained how translation is nothing besides addition, an…

Yes. I was able to make a Quake-like clone when I was 17 with no knowledge of how matrices worked or linear algebra. This was before Unity et al, so I had to build it from scratch. You can get surprisingly far by stringing magical utility functions together.

The reason I know those things now is because I wasn't forced to learn them then. Detail comes after engagement.

Re: Scratchapixel: Computer Graphics Programming from Scratch

#9
This is a great resource! For those interested in a very quick and direct intro to writing code for ray tracing, something I think supplements Scratchapixel nicely, you might want to also check out "Ray Tracing in One Weekend". http://in1weekend.blogspot.com/2016/01/ray-tracing-in-one-we.... It's a $3 ebook on Amazon, but the blog post has lots of free resources including the complete code for the small ray tracer developed in the book. Written Peter Shirley, by a graphics prof. friend of mine, well known in graphics / ray tracing / global illumination circles.

Re: Scratchapixel: Computer Graphics Programming from Scratch

#10
post #6

What I don't get is why nearly all resources on 3D graphics assume the reader is familiar with matrices and linear algebra. For those who don't speak that language, what you're doing is plotting numbers into a magic box, doing a magic multiply, and hey presto, we got 3D! Magic. Meanwhile a teenager could easily get an intuitive grasp of 3D graphics if you just explained how translation is nothing besides addition, an…

> I'm quite tempted to try write such a tutorial

You should do it! I agree and think that making 3D approachable is possible, and that most tutorials fail to make it easier than already available materials. I'm not sure it's easy to do, but if you succeed then people will benefit and if it turns out to be hard, you'll have developed a stronger appreciation for the problem and/or the motivation to solve it.

Post reply on HN