I'm not sure how it works in the environment you are programming in, but almost always, an image gets drawn beginning from the top left corner.
Therefore the first transformation you do, will use this corner as an "anchorpoint".
Before you do the rotation, try to move your image so the center of your image matches the (0,0) coordinates. Not the top left corner.
so your transformations should be:
- 1: translation with offset(-imageWidth/2, -imageHeight/2)
- 2 and 3: rotation and scale (both don't affect position of anchorpoint, so order doesn't really matter here)
- 4: translation to match image center with frame center (frameWidth/2, frameHeight/2)
I hope this was useful to you.
FriesBouryMember Since 28 Sep 2012
Offline Last Active Oct 12 2012 04:48 PM
- Group Members
- Active Posts 3
- Profile Views 2,194
- Submitted Links 0
- Member Title Member
- Age Age Unknown
- Birthday Birthday Unknown