Rotating a Bitmap

Started by
2 comments, last by timbobsteve 18 years, 3 months ago
I know there is SDL_gfx that has rotozoomer.h for rotating and zooming images/surfaces, but I am a little bit of a masochist (spelling) and I would like to learn how to do it myself. Can anyone provide any info, directions or tutorials on doing it all myself. I have the SDL_gfx library, but it isn't very well commented (apart from explaining the interfaces). Thanks for any help you can give.
Advertisement
I've been meaning to write a tutorial on this topic. There's nothing like understanding software rendering for adding 10 lbs. to your crowbar.

If you want to do it with SDL, you're not completely out of luck. There's a common myth that per-pixel access in SDL is dead-slow, but with understanding of the API and a little optimization it can be done.

Basically what you're doing is 2d affine texture map.

Start with doing 2d rotations of your vertices. mathy clicky.

Scan the edges, and interpolate all the u/v values.

Too lazy to look for links... will later.
Of course, there's always OpenGL.
Sry... openGL is a no go zone on the GP2X... no one has made a complete port of it... and even so... it would run like a turtle towing a truck.

This topic is closed to new replies.

Advertisement