Book Reviews from 2003


3D Math Primer for Graphics and Game Development

By Fletcher Dunn and Ian Parberry


Cover art: 3D Math Primer for Graphics and Game Development

3D Math Primer for Graphics and Game Development is an excellent introduction to 3D Math, but it's important to understand what it's not. It's not a book about writing games. It's not a book about DirectX or OpenGL. It's a book about mathematics and the geometrical interpretation of the mathematics. In other words; this book provides the foundation you need to use and understand 3D graphics. That's not so say it's solely a math book. Besides providing pictures, illustrations and descriptions to help you visualize and understand the presented math as it pertains to geometics, the authors also provide C++ source code for most of the basics presented, giving you that important link between linear algebra formulas and implementation, a link that many people -- myself included -- value greatly.

The source isn't interjected into the discussion, but instead provided at the beginning or end of chapters. The source isn't used as filler, it's actually helpful to read through, and available in the book for a reason. Some of the source discussed isn't in the book but must be downloaded from the homepage -- this to save trees and to keep the page count and cost of the book down, the authors explain.

It's important to understand that this book provides only a base to build upon. I estimate some 90% of the book is about basic math and geometric primitives and processes (lightning, though nothing on shadows), with the last 10% or so branching out to talk about higher level concepts such as how to represent triangle meshes and visibility determination. Short on higher level topics, but to the point and clearly explained, with references provided if you want to dig deeper into occlusion or mesh merging or any of the other topics only touched in passing.

When I decided I wanted to read up on 3D math I researched a couple of books, but I went with this one because it made clear that it'd focus on the geometric interpretation of the math. I'm very pleased with my choice.

Most of the chapters end with a short list of exercises, the answers to which exist on the homepage.

I should probably try and think of some faults, but I really can't. Maybe some would like to have all the code come on a CD-ROM, but why? I could be anal and complain that they use C-style arrays instead of the STL, but that's probably in the interest of being light-weight and simple. I only have one real gripe; the demo code available on the homepage is Windows(R) based, and the renderer code provided (see renderer.cpp in code.zip from the homepage) is strongly coupled with Direct3D, even though the author(s) provide a large rant about the importance of being cross platform and not simply 'learning an API'. Apparently they gave in to what 'people want' instead of doing the right thing, which would have been to target GCC and SDL and/or GLUT. But this is nitpicking, the book doesn't even mention the demo code that I remember, and the most important parts of the code is cross platform.

Highly recommended for 3D beginners who want to begin at the correct end of things.


How To Write A Damn Good Novel, II

Advanced Techniques for Dramatic Storytelling

By James N. Frey


Cover art: How to write a damn good novel, II

Book two continues and expands on the first work. When I was about to buy these books I was contemplating buying only one. I could go with only the first one, or go directly to the second assuming that it would contain everything worth knowing from the first. I can now tell you that the second book is not a straight rehash of the first, though it does, in addition to new topics, cover and expand on some of the old ones too.

One thing you'll recognize from the first book is Frey's focus on Premise as the guiding light in creative writing. We're treated two chapters expanding on the one found in the first book. Another revisit is on The Voice. One reason I like this book, and I do, is that Frey is big enough to admit mistakes. In the chapter on the voice he reviews some of his own advice and correct it, and he use one of his early papers as a basis of discussion and blasts it, showing that no, you won't get everything right from the start, but the only way to get better is to write, take in critique, face the fact that your work might in fact suck and learn from the experience. That he admit to giving bad advice creates trust, which is important for acceptance of the material presented.

On a tangent; One can often hear "Intellectual Property" proponents speak about how authors must get paid or no new work would be produced. They'll spout out some trite about "piracy", how it endangers whole professions and how we might head toward a future with no books, no computer games, and no movies! That's utter bullshit of course which if I may be so bold and presume, I think Frey agree with me on. The reason I so presume is because Frey talks about "The Writer's High":

The writer's high is what reinforces this mysterious compulsion to write and rewards the creative act long before a check ever arrives from a publisher. The writer's high is such a powerful influence on some writers that nothing else matters -- wheter they publish or not becomes irrelevant. They've become writing junkies, hooked on the creative art.

Books, plays, movies and computer programs will always be produced because there are people out there for which the act of creating is the greatest thing on earth and for whom money and success is secondary. I will also hypothesize that the best work is written by these.

I liked this book, it offered me insights into writing and a connection to writers -- in that I've experienced the programmer's high. It is the most amazing thing...


How To Write A Damn Good Novel

A step-by-step no nonsense guide to dramatic storytelling

By James N. Frey


Cover art: How to write a damn good novel

As much of me wanting to dive deeper into the vast depths on creative writing as to offset the highly technical book on C++ Templates that I was actually after, I decided - on impulse - to put this book and its sequel in my on-line shopping cart. Having read a book focused on character development I felt that something a little more whole-encompassing would be nice.

Having now read the first of the two books in this series, I don't feel sorry for having that impulse. While the aforementioned Seger book just left me empty, this one had me laughing out loud several times. Where Seger would spend a chapter on - to me - offensive political correctness, Frey came across as a no nonsense tell-it-like-it-is person, not shy of bringing up "controversial" topics such as sex. I've never read any of his fictional works, but I got to impression that Frey knows that of which he's talking.

Also, Frey doesn't try to make his work all-encompassing. He's very clear in the introduction where he makes it explicit that his book is about writing dramatic novels, no more, no less.

The first chapter is "What it's all about is who", where I learned a new thing right from the start, namely that characters in a drama should work at their maximum capacity. I've never really thought about it before, but it kind of makes sense. This is what ensures that the reader/watcher doesn't think of your character as stupid for not doing things to the best of their abilities. I'm sure we'll all read or watched a spy thriller and though "Hey stupid, why don't you just post the damned info on the usenet already?!".

Next up is "The three greatest rules of dramatic writing: conflict! conflict! conflict!". Hardly news if you've done the least bit of writing. Frey talks about proper pacing and genres. Chapter 3 is "The tyrrany of the premise". Frey puts a lot of weight on premise. Keeping to the premise and what to do if you drift from it come up several times over the following pages.

In "The ABC's of storytelling" we learn about where to start the story, and what a stepsheet is and how one use one. Next is "Rising to the climax", again reinforcing the importance of, and explaining how the climax should prove the premise.

Chapter six is "Viewpoint" which I found very interesting because it talked about things I've wondered about, which is; how do you select a proper point of view and voice for telling the story. Also warns about abusing flashbacks.

"The fine are of dramatic dialogue" is about proper prose and how to go from a rough draft to something fluid and beautiful, which continues in "Rewriting" which talks about how to extract an objective measure of quality from your work.

Finally, in the last chapter, "The Zen of Novel Writing", Frey takes out a sledge-hammer when explaining the harsh reality of being a writer. The core point he makes is that anyone who really wants to become a writer, can. All it takes is time and effort. The road is clear, you must take the time to write, write and write some more. Personally I felt a little intimidated by this seemingly cold verbal barrage, even though I don't really want to become a novelist. I merely want to understand creative writing for my own entertainment.

At 170 pages in a small hard-cover format, though a little too big for handy on-the-commute reading, the book can be read in no time. I'd like to be able to list this as a fault, but I really can't. Frey's nine chapters cut to the chase and doesn't waste words repeating himself over and over again. The book is, thankfully, completely devoid of useless filler, like "how to format your manuscript" and such.

In summary, I enjoyed this book a great deal, and feel that it helped me closer to my goal, not of becoming a novelist, but of understanding creative writing.


Fermat's Enigma

The Epic Quest to Solve the World's Greatest Mathematical Problem

By Simon Singh


(image missing) This book on Amazon

Singh is probably best known from his "The Code Book", which I haven't read. Yet. With this work I learned that he's very capable of writing clearly and captivatingly about science, even material which most people would regard as extremely abstract; the mathematics of number theory, so I might read his better know work if I happen across it.

The first two thirds of this book trace the history of the theorem, from Pythagoras to Wolfskehl. We learn about Fermat and about those following him during some 350 years, trying to solve the riddle he posed; to prove that there are no integer solutions to an+bn=zn for n>2.

It is always fascinating to read about bright minds and their all too often tragic history. I clenched my fist as I was reminded of the fate of the libraries of Alexandria and their best known keeper, the woman scientist Hypathia. The destruction and loss of major parts of the world's collective knowledge aside, certainly the most tragic life is that of Évariste Galois, known to me earlier only as the anonymous name in "Galois fields".

Finally, of course, we're told about how the enigma finally fell, at the hands of english mathematician Andrew Wiles.

If you're the least bit interested in math and the history of mathematics, I suggest you give this book a try. Anyone can read it, no specific math knowledge is required, only the ability to appreciate it. The paperback is about 350 pages and easily digested in one sitting. If that's too easy, you can always follow up with the final paper; "Modular elliptic curves and Fermat's last theorem"

(I read the Swedish translation, "Fermat's Gåta", ISBN 9172631341)


Qt Programming

For Linux® and Windows® 2000

By Patrick Ward


(image missing) This book on Amazon

Where to start, where to start. I picked up Qt Programming at the library thinking that I could make a focused effort to "get off the ground", so to speak, using this book. However, where I hoped to get a good introduction to the framework and how to write robust Qt applications, I instead found what feels more like a hodgepodge of a braindump by the author. The book purports to give you enough material to "Master the Qt Toolkit and programming environment", according to the back cover. Nothing could be further from the truth.

The premise is good. The author shows you how to write a basic application, and explains the different types of classes that are available in the toolkit, and gives some basic information on how you typically instanciate and extend these classes. The problem is with the quality. The quality isn't there. After a while I started to wonder if maybe at some point the author lost his working copy and had to OCR in an old print out, because the example code he gives you is completely riddled with typos.

Let me give you a couple of examples. At page 44 there's a class member delbot() which contains only the code "delete bottom, bottom = 0;", which the book goes on to describe like this:

The delbot() slot simply checks to see if the bottom NewWidget (a pointer) is equal to zero and if not, deletes the object it points to.

Really? In what language? On page 46 there's a member function that does "delelete this;", and so on and so forth. Some errors are easily fixed, but sometimes the code makes almost no sense at all, and it certainly doesn't come anywhere near compilable. Let me summarize the problem with this example from page 131, trying to explain QBuffer:

// A roundabout variable initializer
int a, b;
QByteArray s;
QBuffer b( s );
QTextStream ts( &b );
ts << "456 123" << '\0';
QTextIStream tis( &arr ) >> b >> a;

He declares b as an int, then redeclare it as a QBuffer, and then create a QTextIStream from a nonexistant object. Any questions? Feel free to try and figure out the minimum edit distance to get working code.

At the core this book is 50% reference (mostly page after page of tables listing available member functions or classes in the toolkit) and 50% rather low quality tutorial material in a snippet form.

I really wanted to like this book, but I couldn't, and what's worse, I just can't figure out the target audience. If I had to guess, I'd say it's targeted at people who must learn the toolkit, but for some reason or another are unable to digest information unless it's in print. For the rest of us, online tutorials and the toolkit documentation offers superior quality.

Anything good? Well, the author gives us his logging class and a ten page dump of a crossplatform sockets-library with minimal functionality. Maybe of use to someone?


Exceptional C++

47 Engineering Puzzles, Programming Problems, and Solutions

By Herb Sutter


Cover art: Exceptional C++

The Exceptional C++ series isn't your typical programming language book, but more like that of Effective C++ by Meyers. The goal is to teach best-practices in C++ programming. The source material for this book is the well known Guru of the Week feature of comp.lang.c++.moderated, but the material has of course been revised, regrouped and extended.

As you can probably imagine, a large part is spent on the topic of writing exception safe code, with memory management coming in second. If I compare it with the work of Meyers I find that Exceptional C++ is even more focused on details of implementation, while Meyers had more of design principles in his book. There's quite a few references to particular items of Effective C++ in this book, and they really doesn't seem to overlap as much as one could think.

Like Meyers, the format of the book makes it very comfortable bedtime reading. Most items keep below five to six pages, so finding a place to "call it a night" is easy. I find the language and writing to be quite easy to digest, while the occasional attempt at humor... well, let's just say that you don't buy this book solely for the jokes.

For me, working through material was a real roller-coaster. One moment I'd light up with joy for correctly "guessing" the answer to a problem, to turn the page and and face depression and stupidity at the next.

An orgy in standard-masturbation, this book if for people who are dead serious about being the best C++ programmers they can possibly be. You know if you're one of them.

(This book is part of the C++ In-depth Series, edited by Bjarne Stroustrup)


Pascal Implementation

By Steven Pemberton & Martin Daniels


Once again an older abandoned title which has been OCRed and put online. The title, Pascal Implementation, is spot on in this case as this book is basically a code review of a P-code generating recursive-decent driven Pascal compiler implemented in Pascal. Forget about automata theory, this is about implementation, period. The text goes through the compiler, procedure by procedure -- occasionally line by line -- documenting its implementation and commenting on how the code could be improved.

I was initially quite excited about this text, but after a while it all blurred together and everything started to look the same. I greatly appreciate the work that went into getting this scanned and online, and it might well be a valuable resource for someone, but I think the code too dated to make a good example if you were to develop a compiler today. The preface has this to say:

Another use of this book is to support the study of programming methodology. It is well known that a good way of learning how to program well is to critically read other people's programs, especially as so much of programmers' time is spent maintaining and altering programs they did not write.

It then goes on to say:

The fact that it is possible to understand the whole of this compiler in a relatively short time is witness to its good design and style, and it is this good style that allows improvements to be easily found.

That might have been true 10-20 years ago, but as I look at the source today all I see is a jumbled mess (and I'm pretty comfortable with Pascal), much because of an unnatural over-reliance on nested procedures, but also because it uses fixed length strings, complex unions of structures topped off by badly encapsulated algorithms. But then, this is standard Pascal. One cannot expect them to use OOD when it isn't supported by the language.

A few good things can be gotten from this text. For one, it's a pretty full implementation of Pascal on the front end side (the back end is not as complete), so you can see how problems such as parsing set declarations and multi-dimensional arrays are handled. Secondly, I haven't been able to locate any other on-line source for information on the P-machine and the P-code instruction set, but here it is, though hardly in-depth.

As you probably can tell, I'm going to be hard and judge this text on what it brings to the table today, which I'm sad to say is not very much, at least not for me.

If you're at all interested, browse it and see for yourself, maybe it'll serve you. Note that the compiler will not compile under Borland Turbo Pascal without changes; mainly the renaming of a variable clashing with a new keyword, and handling of standard input/output.


Creating Unforgettable Characters

By Linda Seger


Cover art: Writing Unforgettable Characters

Getting into something different from the usual comp-sci stuff, I decided to pick something up on creative writing. Whereas with said comp-sci litterature I feel that I can pick the good ones from the really bad ones, I know nothing about what "must read" books there are in the field of writing, but I happened across this one while browsing Amazon and it had a couple of good reviews, and where better to start than with the characters, I thought?

Unfortunately, I found it to be quite thin on non-obvious ideas. What I can only presume is the "usual stuff"; things like creating a backstory, and making characters psychologically inconsistent (internal struggle) to make them to feel real and interesting are all there, but I don't feel like I got any better at it by reading those chapters. Much of the basic "do this, do that" ought easily fit a single page, and certainly I would think that there are websites out there where you can get the same kind of "hints" as to how to write unforgettable characters.

All in all I feel that I don't care either way. I don't hate it, but I can't come up with anything good to say about it either, which makes this review all but pointless.

237 pages including index and a section on being politically correct.


©2003 Eddy L O Jansson. All rights reserved. All trademarks acknowledged.