Charles Petzold



3D Book: Progress Report

February 5, 2007
New York, N.Y.

My contract for the book tentatively entitled Windows 3D: Three Dimensional Graphics Programming for the Microsoft Windows Presentation Foundation specifies that the book be about 350 pages in length, and that I should have half the manuscript delivered by January 31st.

As of today, I've submitted 40% of 350 book pages to my editor at Microsoft Press, so I'm not alarmingly far off the schedule. Whether I finish the book by April 30th as the contract optimistically specifies — well, only time will tell. But writing this book is a full-time job so it's entirely plausible.

When negotiating a book contract, I am required to present a proposal that includes a chapter outline. Almost always, when I actually start working on the book, that outline goes straight in the trash. It's not that I wouldn't like to work from a strict outline, but inevitably I find that actually writing the book causes me to rethink the ordering of material.

For example, the 1st of 8 chapters in the outline is entitled "The Three Dimensions" which was supposed to cover the 3D coordinate system and vectors. Necessary stuff, of course, but a whole chapter? No way! So, the first two chapters in the outline got merged into the first chapter of the book, now called "Lights! Camera! Mesh Geometries!" That chapter begins with some basics of 3D coordinates and vectors, then puts together simple scenes. I cover both PerspectiveCamera and OrthographicCamera, both AmbientLight and DirectionalLight, and DiffuseMaterial but only using a SolidColorBrush. In the discussion of MeshGeometry3D I cover Positions and TriangleIndices but not Normals or TextureCoordinates.

The original outline has "Transforms" as Chapter 3 and "Animation" as Chapter 5. These topics are so closely intertwined that I decided to cover them together in the book's Chapter 2, which is "Transforms and Animation." It turned out to be huge: about 92 book pages. It might seem as if transforms and animation are rather "advanced" graphics topics and shouldn't be covered in Chapter 2, but I feel that in 3D programming, transforms and animation are essential. This chapter focuses on the standard affine transforms only. It doesn't cover MatrixTransform3D or even Matrix3D, and also ignores quaternions. Those are the advanced topics for a later chapter.

So, the chapters are shaping up something like this. (So far, I've finished and submitted the first two chapters.)

I have a little bit of hit-testing in Chapter 2, but I think that Chapter 6 is the place to put more complex hit-testing, such as interactive dragging of 3D vertices, because that job really requires accessing the camera transforms to convert between 3D space and 2D screen space. (But maybe hit-testing needs to be in Chapter 5?)

The last chapter of my original outline is entitled "Curiosa" and I might still want to end with something like this. I'm thinking stuff like using WPF 3D to make anaglyphs, or to generate movies from individual 3D snapshots for renderings and animations that are too complex for real time, and anything else I can think of that wouldn't quite fit into the other chapters. If anybody has ideas, let me know!

Those days like today when I submit a chapter to my editor are always nice, because I can then take a mini-vacation for the rest of the day and not feel one speck of guilt. I'll be back to work tomorrow on Chapter 3.