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

Author Topic: How to extract Rotation And Scale from sf::Transform  (Read 4486 times)

0 Members and 2 Guests are viewing this topic.

person999

  • Newbie
  • *
  • Posts: 3
    • View Profile

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: How to extract Rotation And Scale from sf::Transform
« Reply #1 on: July 28, 2024, 03:07:42 pm »
Not exactly. sf::Transform is essentially a 4x4 transformation matrix. So all the applied operations are calculated into the matrix and thus you can't extract the original inputs.
What you can do with a transformation matrix is decompose it into it's combined components (translation, rotation and scale), see also this StackExchange answer.

As for the StackOverflow question, I'll answer there directly.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

person999

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: How to extract Rotation And Scale from sf::Transform
« Reply #2 on: August 01, 2024, 12:02:49 pm »
Thanks man, it helped me alot. I was very confused with the coordinate system and this transformation matrix because I am new.