Hacker News new | ask | show | jobs
by davidwf 1960 days ago
I have to say this looks really cool.

Maybe this is a really dumb question, but as someone who really knows nothing about computer graphics, how can you actually run these examples?

I realize that I could Google and research and find a list of "canvas drawing tools" in a variety of languages that I could then evaluate (despite, again, knowing nothing about graphics), but it'd be SUPER-SUPER-awesome to have a quick note "there are lots of ways to go about making these things happen in the real world, but here's one I recommend if you have no other priors." :-)

Really cool book idea, keen to have a go at it!

3 comments

The demos run live in the browser. You can download and edit them. The code is pretty straightforward and well commented.
Wow thank you! I totally missed the "Source code and live demo" button during my first cursory glance through the chapters, but indeed, there it is. :-)
HTML5 Canvas is probably the easiest to get going with some Javascript.

Python has PyGame, or you could just plot to PNGs.

Java awt has a canvas.

C/C++ has SDL/SFML or also plotting to PNGs (or if you want to go wild, embedded GPUs are an option).

You could also do all of this in BASIC if you write the canvas commands. All of this is doable on a Commodore in software albeit slowly.

Here's one of the demos, running right inside your browser: https://gabrielgambetta.com/computer-graphics-from-scratch/d... If you right-click-view-source, you can see the whole JavaScript implementation right there.

This might be the easiest way - make a trivial HTML page with a <canvas> tag and start setting pixel colors in it :)