GP32 bitmaps/sprites rotation, etc....


ardnut

Still Fresh
Joined
Oct 17, 2003
Messages
31
I've followed Rico's tutorials http://www.thaworx.co.uk/ninja/tut1.htm and have a working program that loads a custom map with custom bitmap tiles and scrolls around, so I have a basic understanding of how to draw bitmaps to the screen, move them around, etc...

What is the best way to do rotation on a bitmap/sprite. Say for example I have a top down view of a character, which is just a bitmap facing in one direction. How do I rotate this? An API such as OpenGL has functions that you can use for this but I assume that as the GP32 doesnt have any advance graphics chip then you have to do this some other way? I did think of just creating lots of images of the sprite facing on different directions then just animating it, but this doesnt sound the best way to do it, especially if I have lots of different sprites that need to be able to rotate.

Another question, is there any way to change a bitmaps shape at run time? for example if I draw a simple square bitmap on screen then how would I then stretch the corners, making the bitmap to be displayed as a trapezium shape (i.e. creating a very simple effect of perspective)

All help is welcome, code examples, tutorial links, suggestions, etc...

Thanks.
 
Yes, there is no hardware support for bitmap rotation. It will have to be done in software. To rotate along the axis, draw a line in the middle of the sprite and shift the pixels accordingly. Yeti3D probably has this functionality embedded.
 
yea, I had a look through the yeti code and found a few functions that I might be able to use, just might take a while to get my head round exactly what they do.

If someone has any generic functions for rotation and bitmap scaling/morphing that I can have a look at then that would be great.

Anyone?
 
Back
Top