Tuesday, June 26, 2012

Sprites

[Sprites]
Finally got the sprites for the vehicle working but stil need to work on scaling the game for complete accuracy. Trying to make sprites with a different axis is such a pain, I had to flip the matrix to make it work but worst was that the ai library had no simple function to rotate the sprites such as degrees or radians(it only has forward and side vectors to work with which was beyond my knowledge until I revise my physics XD) so i had to manually rotate the matrix based on the vehicles movement. And here is the result:


Normally when we draw sprites such as HUDs in a 3D world, it is usually on the X,Y asix and can use the typical 2D calls, but the problem here was that I wanted to use the sprites  in a 3D world for all sprite objects which uses the X,Z axis, we have to change the matrixes to fit with the world and by zeroing out the y axis on all Vectors. You might be thinking "Why would you put sprites in a 3D world?" Well, the answer is that by doing so it leaves room for me to work on the game in the future to make this game full 3D without rewriting much of my code. In fact I could just load in the models for the 3D, attach the objects to the camera and be done with it :D.

No comments:

Post a Comment