Having gone thru the 2D Turorial, I learned how to load, draw, move, and rotate a sprite using the XNA framework. Then I had a look at some sprite sheet tutorials, such as Sprite Sheets in Xna: The Basics
Now I wanted to get my own graphics in play, and simulate some 2.5D. Specifically, a 3D rendered object that would show a different angle depending on the direction it is moving, roughly like so:
Now if we were doing a straight top down view, we could use a single overhead image in our sprite, and just rotate it in XNA. But since we are showing a little bit of perspective ( note how you can see the near side of the tank slightly in the left and right views ), we will need some pre-rendered images of all ( or most ) of the possible angles the object can be seen at.
I grabbed a free model from TurboSquid.
I found several scripts for 3D Studio, that would help automate the process:
Other utilities used to finish the process:
Here is what my first attempt resulted in (rough version with bad shadows):
I was able to render these to PNG format so the transparency mask was built in, and worked perfectly to blend them to the background in XNA. I created a new class for my game objects, that would automatically display the correct panel based on the object’s current direction of movement. And then I tweaked it one step further, that if the rotation in the image wasn’t an exact match to what was happening in game, it would compenstate by adding a a slight amount of rotation to the sprite as well. After a bit of tweaking, this came out very nice.