Mini-Game: Dwarf vs Zombies (Part 3)

by Chris at 3:01 pm

Welcome to Part 3 of Dwarf vs Zombie. In this weeks episode we will be prodding those lazy little models in the back side and telling them to get to work. You will remember the anoying maths that we needed to do for the quaternions?, well you can be thankful that all that is over and we wont need to look at it again :D

Articles
Part 1 - Stuff to download, getting into the development
Part 2 - Setting the Scene, and Model Drawing
Part 3 - Animation

Downloads
Source: Click Here

Code Updates
There isn’t really much to talk about here that hasn’t already been talked about. I added a few classes to do the maths (Quaternion, Matrix), added a new Joint class, and got it all working together. Here’s a list below if you want to download and look at the code.

* Added Joint Rendering to Render() routine
* Added Joint setup to SetModelData() routine
* Added Joint class
* Added Quaternion class
* Added Matrix class

Performance Tuning
I mucked around a little with the Model.Render() routine, and the Model.Update() routines a bit to try and get some more frames out, and managed to get it running at 60fps on my system.. I know it can do more, but just cant figure out what is slowing it down. Is only 2 models… and a total of 2831 triangles being rendered each frame. Surely we can do better than that!

And finally, some magic
Look at that pretty picture at the top. If it’s animating the way it should be, you will see our two models doing a bit of moon-walking :P