• Advertisement
Sign in to follow this  

[SDL] Image moving when rotating with sdl_gfx

This topic is 3233 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

Hello guys, i'm having a problem... I trying to rotate a image with sdl_gfx but it "moves" a little when rotate. I think it happens because when rotated, the image gets bigger, so i used D = 128*cos(30) + 128*sin(30) - 128 where 128 is the width of the square and 30 is the angle used to rotate (of course i used 30*PI/180 in the code. D is the difference between the side of the new and the old square. But it is wrong! can someone point me in the right direction? Here is a image to show what i tought: http://img11.imageshack.us/img11/804/examplet.png [Edited by - Lobosque on April 17, 2009 10:44:34 PM]

Share this post


Link to post
Share on other sites
Advertisement
If you're centering the image wouldn't you want to use half of the size instead of the whole size?

Share this post


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

  • Advertisement