A couple more errata have come in since the last update. From Tim Lowery comes:
“On page 117, the figures look mislabeled, or the axis is incorrect. For example, Figure 3.5a shows x-axis rotation, but the object is rotating around the y-axis. Likewise, for Figure 3.5b.”
In this case, the captions are correct (the intent is to go in x-y-z order), but the figures are reversed.
From k. avery comes:
“At the end of p. 623, cot theta should be csc theta / sec theta, not sec theta / csc theta.”
Indeed it should be. And I had thought I caught that one once before. Evasive devils, those cotangents.
I’ve finally gotten around to creating a formal errata file, and a code update. The code update is an encrypted ZIP file; the password is the second word on page 37. The paths should be set up correctly to match the original CD. To use, simply unzip it to the directory where you copied the CD contents.
If there are issues, you can post a comment here, or write me by using my first name at this domain.
Now we come to the final part: merging Newton-Raphson and bisection together, and choosing the correct one depending on the situation.
(more…)
Due to preparing for a week of vacation, and then going on a week of vacation, and then recovering from a week of vacation, this blog has fallen from the wayside a bit. But I’m back, and I’ll try to wrap up this topic in a couple of postings.
When last we left our intrepid heroes, we were discussing Newton-Raphson root finding, how it’s used for reparameterizing a curve, and when it fails (namely when the speed on the curve approaches zero). The solution hinted at was the bisection method.
(more…)
I’m still optimizing memory and speed so nothing exciting to report under the lighting topic. Maybe later this week or next week.
So let’s look at a bit of code from the book, shall we?
(more…)
William Brennan points out that on page 84, the equation
\mathbf{w} = \mathbf{u}(\mathbf{v}\otimes\mathbf{w}))
is not correct. There are two ways to rewrite this. In one the intended order is correct, but is missing the transpose operator to indicate that it’s a row vector:
\mathbf{w} = \mathbf{u}^T(\mathbf{v}\otimes\mathbf{w}))
Alternatively, you can generate the same result with a column vector by doing:
\mathbf{w} = (\mathbf{w}\otimes\mathbf{v})\mathbf{u})
In Chapter 3, we simplify the Rodrigues formula (page 123) and general planar reflections (page 128) by using the tensor product. Since the arguments of the tensor product are the same in these cases, the ordering doesn’t matter. However, the ordering of the arguments needs to be reversed in the shear matrices on page 132, so

and

Other tensor product arguments may need to be reversed elsewhere in the text, though I can’t find any at this time.
Reported by Richard Ruth: In Figure 1.9 on Page 26, the label on the hypotenuse should be
.
There is a bug in the code that gets the axis and angle information from a rotation matrix. Where the angle is 180 degrees (the last else statement) it computes the reciprocal value incorrectly. The original code is:
The fixed code should be:
This should be corrected in both IvMatrix33 and IvMatrix44.
This is both a correction, and an improvement to the creation of a quaternion from two vectors. Or as it is commonly known, Shortest RotationArc.
The current code doesn't handle the case where the two vectors are opposing; there's an if statement to detect it, and a comment, but no recovery code. The problem is that there are an infinite number of orthogonal rotation axes -- we just need to pick one. The solution is to check to see which axis the start vector (it could be the finish vector, it doesn't matter) is generally pointing along. If it's pointing generally along the
-axis, then we take the cross product with the
-axis to get our rotation axis. Otherwise we take the cross product with the
-axis.
(more...)
Ah, our first errata. How bittersweet.
Eric Mumau sent me this one. On page 499, equation 10.11 is wrong. It should read:
\mathbf{p}+2(\mathbf{v} \bullet \mathbf{p})\mathbf{v} + 2w(\mathbf{v} \times \mathbf{p}))
Correspondingly, the following equation should read:
 = (2 \cos^2 (\theta/2)-1)\mathbf{p} + 2(\hat{\mathbf{r}}\sin(\theta/2)\bullet\mathbf{p})\hat{\mathbf{r}}\sin(\theta/2) + 2\cos(\theta/2)(\hat{\mathbf{r}}\sin(\theta/2)\times\mathbf{p}))
The rest of the page follows as before.
This affects the code which starts at the bottom of page 499. At the top of 500, the first three lines should be rewritten as:
C++:
-
-
float vMult = 2.0f*(x*vector.x + y*vector.y + z*vector.z);
-
float crossMult = 2.0f*w;
-
float pMult = crossMult*w - 1.0f;
-
Note that the code on the CD is not the same as that given in the text, and in fact will actually work. However, it is slightly less efficient than what is given here.