Rotation, further I go from 0:0, the further the object positions around the origin while rotating

Posted by Serguei Fedorov on Game Development See other posts from Game Development or by Serguei Fedorov
Published on 2012-11-22T18:22:18Z Indexed on 2012/11/22 23:10 UTC
Read the original article Hit count: 212

Filed under:
|

For some reason I am having the issue where the following code:

 global.spriteBatch.Draw(obj.sprite, obj.getPosition(), null, Color.White, obj.rotation, obj.center, 2f, SpriteEffects.None, 1);

causes the object to rotate around the origin in such a way, as though there is an offset to the position relative to its location. The calculation for the center it correct and this happens even if I set the pivot to be the location of the object. The further I get from 0:0 the larger the radius or rotation. I am not sure what is going on here because given the following tutorial

http://www.riemers.net/eng/Tutorials/XNA/Csharp/Series2D/Rotation.php

I have done the code setup correctly. Any ideas? Any help is greatly appreciated!!!

© Game Development or respective owner

Related posts about XNA

Related posts about rotation