New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation misleading concerning the order when combining transforms #1608
Comments
I don't remember this kind of stuff that was written a long time ago, so the best thing would probably be to test it. A rotation combined with a translation should be a good case to figure out which one is applied first. |
Indeed, I have done exactly that before posting to be sure. Here is the snippet: auto transform = sf::Transform();
transform.translate(2.0f, 3.0f);
transform.rotate(90.0f); Then, I print the entries of the matrix:
Which corresponds to rotation first, translation then. I think that the tutorial on transforms is also misleading. It is said that :
I think it should be written: "They will all be combined sequentially in reversed order". |
Clarifies order of combine() and equivalence of operations. Closes #1608.
Thanks for the report, I created a PR in both SFML and SFML-Website to address this. |
Clarifies order of combine() and equivalence of operations. Closes #1608.
Clarifies order of combine() and equivalence of operations. Closes SFML#1608.
Clarifies order of combine() and equivalence of operations. Closes SFML#1608.
Clarifies order of combine() and equivalence of operations. Closes SFML#1608.
Hello,
If I understand well the source code of
sf::Transform
, when we do:C is equal to A*B with * the matrix multiplication.
And when we want to transform a point:
We have v = A*B*u.
So it is B that is applied first on u, then A.
However, in the documentation of combine, it is said that:
According, to this sentence, C would be equal to B*A (applying A followed by B). I think it is misleading.
Correct me if I am wrong.
Best regards,
Pierre
The text was updated successfully, but these errors were encountered: