XNA DebugDrawer

in

Whenever I had to tackle complicated math in my projects, like calculating the terrain normals for the islands in IslandWar or when I just needed to see the rotation of my models or camera positions, I wished that I could somehow visualize the vectors, target locations and bounding boxes in my scene.

Well, I finally had enough and, over the course of the last weekend, I built a small GameComponent that provides a very simple interface by which different kinds of arrows and boxes can be drawn into the scene. This has proven to be really useful, as I no longer had to guess whether my math was right and whether my unit tests weren't actually at fault when they triggered.

The XNA DebugDrawer component in action

Of course, I couldn't resist packaging the whole thing and I hereby make it available to the XNA community. There might be other uses for it -- maybe a beginner who's put off by all the effects, vertex buffers and whatnot he has to write just to draw a simple triangle would enjoy being able to draw some arrows and boxes with plain single-line calls as his first steps into modern 3D programming. :)

You can download it here!

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Lines and paragraphs break automatically.
  • Allowed HTML tags: <br> <a> <em> <strong> <u> <i> <b> <cite> <blockcode> <code> <ul> <ol> <li> <dl> <dt> <dd> <p> <pre> <span>
  • You can highlight code with any of the following tags: <blockcode>

More information about formatting options