I wasn't expecting to see a 3d rendering treatment!<p>> Drawing complicated scenes in much more complicated in 3D than in 2D—and more interesting, since some real ideas are required. Much high-end 3D drawing, for example in video games or movies, relies on a pixel-by-pixel treatment. the pixels in hardware designed for this purpose incorporate a depth coordinate—that is to say, depth with respect to the plane of the screen—and pixels are colored in the order of their depth, so that close pixels are painted after far ones. This hardware option is unavailable to PostScript, which is essentially device-independent. The PostScript program itself must therefore be responsible for keeping track of depth. The standard method for doing this is to use a binary space partition.<p>Yeah, this is a good reminder that there's no Z-buffer in vector rendering. I haven't used painter's algorithm for a couple decades, but this makes me want to play with PostScript and code up a little 3d surface renderer with a BSP tree and painter's algorithm.<p>I'm also reminded of ray tracing in PostScript <a href="http://www.realtimerendering.com/resources/RTNews/html/rtnv6n2.html#art11" rel="nofollow">http://www.realtimerendering.com/resources/RTNews/html/rtnv6...</a>
I wrote my own PostScript interpreter three months ago, which runs in a browser :) You can play with it at <a href="http://www.ivank.net/veci/pdfi/" rel="nofollow">http://www.ivank.net/veci/pdfi/</a> There are also some demos from 80s and 90s.
I remember being delighted when I learned that .ps "images" were actually programs.<p>At some point I wanted to make a book of PostScript code on left pages / graphical output on right pages, but I only made four pages:<p><a href="https://github.com/hrldcpr/geno-pheno#geno--pheno" rel="nofollow">https://github.com/hrldcpr/geno-pheno#geno--pheno</a>
One thing that bothers me (Chapter 6, page 11) is how they approximate a circle using quadratic Bezier curves, and say that "an approximation
by eight quadratic curves is just about indistinguishable from a true circle." However, if you look at the picture on the next page, you can clearly see the difference.
This is fantastic. IMHO, Adobe should have just stuck with PostScript and forgot about PDF. I remember having to create fractal images for research papers and my dissertation -- the only way to allow them to render at any resolution was to write a program in PostScript -- (very cool to program figures for a paper)! -- no idea if you can program PDF's this way (which, unlike PostScript, I can't edit with a text editor since they're binary).
If you want to run many of the examples in this book, you can (on a Mac) usually create and save a text file (with .ps suffix) and then double-click the file in the Finder. The ps2pdf distiller should convert the contents to PDF and open in Preview. (Not all the IO functions are available, though.)
I took this course at UBC and it was great. Programming postscript to render 3D animated shapes was mind-blowing. Especially cool was that you needed to build <i>everything</i> from scratch