[Request] Sample with Sprite Rotation About Sprite's Own Center

Apr 23, 2013 at 10:05 PM
Hi,

I have been trying to rotate a sprite about it's own center using the SpriteBatch::Draw method and the correct origin. However, the sprite rotates on about another center point, and drawing sprites rotated a different angles forms a "pinwheel" (http://0.tqn.com/d/rubberstamping/1/0/E/D/-/-/purple1.jpg) in which the center of the wheel would be the origin the sprites rotate around, rather than their own, center origin that I calculated using XMFLOAT2 origin(spriteWidth/2.0f, spriteHeight/2.0f)

Can you please provide a quick sample or point me in the right direction.


Best,
  • Chev
Coordinator
Apr 24, 2013 at 12:03 AM
Please show us what code you are using to draw the sprite, and what result you get.
Apr 24, 2013 at 5:19 AM
Edited Apr 24, 2013 at 5:20 AM
Hi Shawn,

Please, close this request. Seems I kept overlooking the fact that I was using the scaled width and height as means to set the origin, instead of the actual width and height of the texture itself. I was probably staring at the screen too long. Just went back to take you screenshots and noticed it right away.

Best,
  • Chev
Coordinator
Apr 24, 2013 at 3:38 PM
Yay! Glad to hear you figured it out.
Marked as answer by walbourn on 1/23/2014 at 11:28 PM