2D rotation problem. - Programmers Heaven

#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

# 2D rotation problem.

Guest
Hello,I have a problem for 2D rotation.When I rotate my sprite,there are holes on the destination image(I think that it's the rounding function).Somebody told me that I have to rotate the dest. image in the oposit side,then,I have to give the color of the SRC's found pixel.But That doesn't work?!

Sorry for my bad explanation(I'm not very good in english).I can send the source(C),for more understanding.

Please help me!

Thanx,

Bye,

## Comments

• Guest
Hi MIG31,

You need to draw the pixels on the screen from top to bottom and from left to right. Then you've to re-calculate (back-calculate) which Texel's (Pixel in Texture) color should be set there.

What yo've done (I think) is: You've draw the Sprite from Sprite to Screen, but you have to it the other way: through screen, onto Sprite, get the color and set it on screen.

To do this you really have to do the opposite transfiguration. Enlarge the coordinates if you want to have a smaller sprite and turn the coordinates left if you want to have a right-rotated image of the sprite.

Hope I helped you - if not, let me know

RuntimeTerror

ps. for further questions: I speak German and a little bit French

URL:www.RuntimeTerror.de

• Guest
Hi MIG31,

You need to draw the pixels on the screen from top to bottom and from left to right. Then you've to re-calculate (back-calculate) which Texel's (Pixel in Texture) color should be set there.

What yo've done (I think) is: You've draw the Sprite from Sprite to Screen, but you have to it the other way: through screen, onto Sprite, get the color and set it on screen.

To do this you really have to do the opposite transfiguration. Enlarge the coordinates if you want to have a smaller sprite and turn the coordinates left if you want to have a right-rotated image of the sprite.

Hope I helped you - if not, let me know

RuntimeTerror

ps. for further questions: I speak German and a little bit French

URL:www.RuntimeTerror.de

Sign In or Register to comment.