Animated Balls

One shortcoming in Super Slam Dunk Touchdown has been the use of my non-animated programmer art balls. The reason for this is the massive amount of work required to make the balls animate correctly with respect to the 3D geometry. This has been bugging me for a while so I decided to take today and try to come up with a way to get the balls working.

The first thing I did was create a ball renderer that saves a file for each angle of the ball, at increments of 60 degrees. This means there are 6 frames for every combination of angles. I really didn’t think I could get away with any less, but this results in 216 frames of animation per ball. Granted, the balls are only a few pixels across, and a lot of the frames can be reused. But I felt it was important that the sprite convey the correct orientation of the ball in play. I started with the football, because that is the most unpredictable ball in the game.

aka the "hand egg"
Fig 1: The Football

I added some white cubes to represent stitching on the 3D model, this way I could tell where to draw them on the sprite. Then came drawing the sprite itself. I created a sprite sheet arranged by X, Y (vertically), and Z (horizontally). The 3D renders were saved as images with the angles used in the file name. It was a simple matter of paging through them on disk and drawing (and later copy/pasting) them as I went.

spritey spriterson
Football sprite in progress

It did take a while, I’m not the most proficient with drawing tools, but I figured it would be easier for Chris to work on these with a living example. Once I finished, I created a routine to get the correct sprite frame based on the Euler angles of the 3D object. Then I modified my renderer to show the sprites so I could spot any errors in my code, or with the sprites.

A football rotates. A nearby sprite does the same. Oh shit, haiku.
Looking good!

Once bugs were fixed, I had to see it in action, and thanks to the magic of the you tubes, you can too!

Add a Comment