Could I get a basic explanation of CATransform3DIdentity?

前端 未结 1 1349
伪装坚强ぢ
伪装坚强ぢ 2021-01-05 06:35

I am slowly getting more serious about Core Animation and would greatly appreciate an explanation composed of short words spoken (typed?) slowly explaining CATransform3DIden

相关标签:
1条回答
  • 2021-01-05 07:31

    CATransform3DIdentity is an Identity matrix:

    http://en.wikipedia.org/wiki/Identity_matrix

    Basically, Matrices in animation mathematics are used to transform an object (skew, move, rotate etc).

    An Identity matrix is one that when applied to an object, it resets it to its initial geography.

    ex.
    [1 0 0]
    [0 1 0]
    [0 0 1]

    It's not easy to explain (I really don't understand properly myself in fairness) but these 3x3 matrices use the grid location (m11, m33) to determine how to transform the object, in this case m11 is is making it rotate 180 degrees, set it to +1 and it'd rotate the other direction. Set it to 0.5 and it'd rotate 90 degrees (iirc!).

    ex.
    [m11, m12, m13]
    [m21, m22, m23]
    [m31, m32, m33]

    It's a bit scary but the pictures here kind of help:

    http://en.wikipedia.org/wiki/Matrix_(mathematics)#Linear_transformations

    and here

    http://en.wikipedia.org/wiki/Transformation_matrix

    Finally, the table at the bottom this this list show how the different fields of a matrix are used:

    Provided via 'internet wayback machine': http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CoreAnimation_guide/Articles/Layers.html

    Finally, I recall reading this a while ago, it might be of some help as I think my explanations above aren't that handy - I'm telling you what, not why - and believe me, you need to know why to get into this kind of programming properly:

    http://chortle.ccsu.edu/vectorlessons/vectorIndex.html

    Best of luck!

    0 讨论(0)
提交回复
热议问题