So I have this texture I am drawing, and the origin is bottom left corner. It looks ok until I have to rotate it.
Without rotation:
With Rotation:
I also tried moving the origin to the center, its better but not perfect:
Here is the code I have used at the last one:
Sprite b = new Sprite(slimeTexture);
b.setPosition(slimeBody.getPosition().x * BOX_TO_WORLD, slimeBody.getPosition().y * BOX_TO_WORLD);
b.setSize(1.6f * BOX_TO_WORLD, (1.6f * BOX_TO_WORLD) / 2.7f);
b.setRotation(slimeBody.getAngle() * MathUtils.radiansToDegrees);
b.setOrigin((1.6f * BOX_TO_WORLD) /2f, ((1.6f * BOX_TO_WORLD) / 2.7f)/2f);
Any ideas why its not fitting perfectly? I tought moving the origin would do it but I have never been so wrong in my entire life.
code
b.setOrigin((1.6f * BOX_TO_WORLD) /28f, ((1.6f * BOX_TO_WORLD) / 2.7f)/28f); The rotation will be correct but makes no logical sense of putting the origin at 11.3,4.2 makes this work. Any one to chime in why this has happened? Or what am doing wrong? – user1001506