I forgot to change the code from my 1.0 book. The custom method I had there can be replaced with the built-in XNA Game Studio 3.0 Matrix.Decompose method.
The Decompose method extracts out a Matrix that contains rotation, scale and translation into its own components.
Here is a link to the help page on the built in method:
http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.matrix.decompose.aspx
It differs slightly with the one currently there. Instead of passing in the matrix you want to decompose, you call the Decompose on the matrix object. The rotation is returned as a Quaternion instead of a Matrix. Regardless, it accomplishes the same task:
"Extracts the scalar, translation, and rotation components from a 3D scale/rotate/translate (SRT) Matrix ."
Isn't it nice when the framework does all the heavy lifting for us?
So to incorporate the built in Decompose method from XNA Game Studio (which I suggest you do), replace the following code:
Vector3 trans, scale;
Matrix rot;
MatrixDecompose(spheres[i].World, out trans, out scale, out rot);
spheres[i].Radius = scale.Length();
with this code:
Vector3 trans, scale;
Quaternion rot;
spheres[i].World.Decompose(out scale, out rot, out trans);
spheres[i].Radius = scale.Length();
And you can remove the custom MatrixDecompose method from the project.
We are only using the scale portion of the matrix to set the radius of our sphere. This isn't required for the demo to run, but it makes it look a little nicer.
Hope this helps and thanks for pointing this out!
Chad