We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Transform.inverse()
No description provided.
The text was updated successfully, but these errors were encountered:
I think it's something simple like this
result := {p: {-t.p.x, -t.p.y}, s: {1/t.s.x, 1/t.s.y}, r: -t.r, o: t.o}
Sorry, something went wrong.
@skejeton Not that simple. You seem to ignore the order in which the translation, rotation and scaling are applied.
Even without rotations, the correct inverse is
result := {p: {-t.p.x / t.s.x, -t.p.y / t.s.y}, s: {1.0 / t.s.x, 1.0 / t.s.y}}
(notice that the p is also scaled).
p
I need to experiment, I thought scaling was relative to the origin, but I'm also now not sure if the origin is relative to position.
@skejeton The th.um documentation defines the following order:
th.um
scale rotation position
So the inverse should be
-position -rotation 1 / scale
The origin parameter seems to be only used for rotations.
marekmaskarinec
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: