Charles Petzold



“Apps = Code + Markup”: The Lost 3D Episode

September 12, 2006
New York, NY

When a book is in the planning stages, the publisher (with input from the author) decides how long the book is going to be. Books generally consist of a number of signatures, which is a single sheet of paper printed and then folded multiple times to create multiple pages. These days signatures are generally octavos, which are folded 3 times to create 8 leaves, each of which is printed on the front and back for 16 pages.

It was decided that my book Applications = Code + Markup: A Guide to the Microsoft Windows Presentation Foundation would have 64 signatures for a total of 1,024 pages. When an author writes more than that (as I have a tendency to do), something must give, and in the case of Applications = Code + Markup, it meant scaling back the scope of the book.

One of the chapters I wrote but which didn't make the final cut now available for downloading:

Chapter 32. Entering the Third Dimension

This is a Microsoft Word .DOC file; if you don't have Word, you can download this free Word Viewer from Microsoft's web site. Here's the source code for the chapter:

Chapter32.zip

This chapter is rather "raw." It was not edited by by editors at Microsoft Press, and the diagrams (which I did directly in Word) are rather sloppy. The art department at MS Press would obviously have redone these.

I wasn't very happy with this chapter. One problem is that a 25-page chapter on 3D programming will barely scratch the surface. But I think I went wrong in another way: Sometimes a writer of programming tutorials has a choice — whether to begin a chapter with a complete program and then describe all the pieces (such is the typical "hello, world" approach), or to build up a complete program from snippets of code. I chose the latter approach for the beginning of this chapter. Consequently, the chapter flops around too much with a bunch of confusing class hierarchies before presenting the first program. If I had it to do over again, I'd probably do it differently. What I'm happiest about in this chapter is that I was able to include a class that generates a non-trivial MeshGeometry3D.

Even with the flaws, I hope this chapter helps people get started in 3D, and I hope I have the opportunity to write more about 3D graphics programming in the future.