One thing that surprised me (in retrospect) about my last sample was that it doesn't make a single reference to a Matrix. All my other apps use tons of matrices. It's hard to do much in 3D graphics without them. Even if you're writing 2D programs with XNA (as I have been, so far), I encourage you to get familiar with the full 3D graphics pipeline, including the functionality of the world, view, and projection matrices. These concepts are still meaningful for 2D apps...just a bit...flatter.
However, one bit of unpleasantness about working with matrices is trying to make sense of them in the Visual Studio debugger. They show up lookiing something like this:
It's tough to look at that mess of text and make sense of it as a matrix.
As it turns out, it's not too hard to write an extension to Visual Studio to view a Matrix (or any other type) in a custom manner. These extensions are called Visualizers, and I decided it was worth learning how to write one so I could more easily look at the Matrix objects in my programs. This article was very helpful (despite being based on VS 2005 Beta 2). Once you have built and installed a visualizer, you will see a magnifying glass icon next to the standard decoding of a variable. Clicking that magnifying glass will bring up your visualizer. Here's what I see now (after clicking the magnifying glass) for Matrix objects:
I don't think it's worth saying a whole lot about the code, because it's pretty straightforward, but let me highlight a few things about it (and visualizers in general):
I find this Matrix visualizer to be very helpful...hopefully you will, too!
As a reminder, if you want to send me feedback about this or any other post on my blog, you can send email to [XYZ]@hotmail.com, replacing [XYZ] with the name of my blog (with no spaces or punctuation).