Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

2D rotation problem.

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

  • 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

  • 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.