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
Add support for animating CATransform3D #39
Add support for animating CATransform3D #39
Conversation
This adds conformance for CATransform3D to AnimatableProperty by decomposing the two matrices into their respective components, interpolating the values in the decomposed transforms, then recomposing the interpolated value into a CATransform3D. This follows the same pattern we use to interpolate CGAffineTransform.
I also tried a version of this using simd types, but it had worse performance (by ~15%). |
4f3b195
to
d8f24da
Compare
d8f24da
to
7d57edf
Compare
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 do not understand most of the math stuffs in there, just reviewing the change set as is and code looks good. The test snapshots are very useful and cool, one suggestion, if we can make the red block different color on each side, it will make the rotation/perspective snapshot animation more obvious.
That sounds like it would be super helpful, but as far as I know CoreAnimation doesn't support this. Layers are really 2D objects in a 3D world, so there is no "back side" to the layer. |
Chatted offline. I misunderstood what the suggestion was. Commit coming shortly to address this. |
… how the view is being transformed
So... the last segment of the shear interpolation test looks really weird. But it's actually doing the right thing. I'll replace it with a better example. |
This adds conformance for CATransform3D to AnimatableProperty by decomposing the two matrices into their respective components, interpolating the values in the decomposed transforms, then recomposing the interpolated value into a CATransform3D. This follows the same pattern we use to interpolate CGAffineTransform.
Resolves #19.