Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: rotate around different origins  (Read 1056 times)

0 Members and 1 Guest are viewing this topic.

uGhster

  • Newbie
  • *
  • Posts: 23
    • View Profile
rotate around different origins
« on: December 25, 2013, 10:37:24 pm »
Hi,
I have a sf::Drawable that has a sprite that draws a sf::Sprite at 0,0 and it has a specified orgin set. eg. center of the sprite.

From time to time I'd like to rotate the sprite around another origin. Is there a way to do this withouth having to transform the object back and forth. As soon as I change the origin of the sprite it moves since the 0,0 will now have the new position.

uGhster

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: rotate around different origins
« Reply #1 on: December 26, 2013, 12:41:45 am »
After some experimenting I figured out that I had to skip the common states.transform *= getTransform(); in draw method and build my own transform.  :D works like a charm now.