-
Notifications
You must be signed in to change notification settings - Fork 15
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
More rendering #19
More rendering #19
Conversation
@fmalita I've added some elements from https://github.com/lottie-animation-community/docs/blob/main/Lottie_Rendering_Model.md regarding the stacking context. I'm not entirely sure the wording is correct though. |
docs/specs/helpers.md
Outdated
Assuming a transform matrix with the following layout, with the labels equivalent to the | ||
[CSS matrix transform](https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know you mentioned there is a reason for using transposed notation, and there is no "right" answer, but it does read a bit weird to me mostly because I'm so used to the row-major approach. It also diverges from the other common specs and literature:
https://en.wikipedia.org/wiki/Transformation_matrix#Affine_transformations
https://drafts.csswg.org/css-transforms/#MatrixDefined
https://www.w3.org/TR/SVG11/coords.html#EstablishingANewUserSpace
We should be able to stick to the same convention, and just invert the defined order or operations, no?
(FWIW, LottieAndroid and Skottie use this aproach while LottieWeb seems to use the transposed convention)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this is what I mentioned in the call, I used the transposed version to have left multiplication
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"left multiplication" - you mean when mapping a point/vector (row vector vs column vector)
vs
?
I don't think either of them is inherently superior, but there is an argument for the latter: consistency with other specs, especially since we are referencing them explicitly. I would find it confusing to read the CSS spec and then have to transpose everything and reverse the order when dealing with Lottie.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's more for composition, if the order of operations is Rotation then Translation, with left multiplication you can do RotMat x TransMat, otherwise you need to do TransMat x RotMat
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've kept the left multiplied version but added a note on the right multiplied matrix as well
docs/specs/helpers.md
Outdated
Assuming a transform matrix with the following layout, with the labels equivalent to the | ||
[CSS matrix transform](https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"left multiplication" - you mean when mapping a point/vector (row vector vs column vector)
vs
?
I don't think either of them is inherently superior, but there is an argument for the latter: consistency with other specs, especially since we are referencing them explicitly. I would find it confusing to read the CSS spec and then have to transpose everything and reverse the order when dealing with Lottie.
* Transforms and coordiates * Auto-link glossary items * Add wording related to the render stack * Fix build * 3x3 Matrices * Explain transforms a bit better * Mention untransformed (0, 0)
No description provided.