SFML community forums
Help => Graphics => Topic started by: person999 on July 24, 2024, 08:12:08 pm
-
Context Of Question : https://stackoverflow.com/questions/78779882/updating-transformable-child-objects-in-a-class-derived-from-sftransformable?noredirect=1#comment138905586_78779882 (https://stackoverflow.com/questions/78779882/updating-transformable-child-objects-in-a-class-derived-from-sftransformable?noredirect=1#comment138905586_78779882)
So, is there any way to extract rotation and scale from sf::Transform class?
-
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 (https://math.stackexchange.com/a/1463487/336687).
As for the StackOverflow question, I'll answer there directly.
-
Thanks man, it helped me alot. I was very confused with the coordinate system and this transformation matrix because I am new.