• Advertisement
Sign in to follow this  

Rotating a Bitmap

This topic is 4384 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement