我可以获得CATransform3DIdentity的基本解释吗? [英] Could I get a basic explanation of CATransform3DIdentity?

查看:156
本文介绍了我可以获得CATransform3DIdentity的基本解释吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在慢慢地对核心动画变得越来越认真,并且非常欣赏由简短的单词(打字?)组成的解释,慢慢解释CATransform3DIdentity以及为什么下面的代码会做它的功能(翻转'3D'空间中的图层)

  kFaceUpTransform = kFaceDownTransform = CATransform3DIdentity; 
//构造一个180度旋转矩阵:
kFaceDownTransform.m11 = kFaceDownTransform.m33 = -1;

第二个想法,快速输入并使用多音节词语,但请保持温柔。



PS。我得到的印象是,如果我要进一步使用动画,我应该对线性代数更加舒服......这是正确的吗?

解决方案

CATransform3DIdentity是一个身份矩阵:



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



基本上,动画数学中的矩阵用于变换对象(倾斜,移动,旋转等)。 / p>

身份矩阵是指应用于某个对象时,会将其重置为初始地理位置。



ex 。

[1 0 0]

[0 1 0]

[0 0 1]



这不容易解释(我真的不公平地理解我自己)但是这些3x3矩阵使用网格位置(m11,m33)来确定如何变换对象,在这种情况下m11是使它旋转180度,将其设置为+1,然后旋转另一个方向。
设置为0.5,它旋转90度(iirc!)。



ex。

[m11,m12,m13 ]

[m21,m22,m23]

[m31,m32,m33]



这有点吓人但是这里的图片有点帮助:



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



此处



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



最后,此列表底部的表显示了如何使用矩阵的不同字段:



通过'互联网备用机'提供:http://developer.apple.com/l ibrary / mac / #documentation/Cocoa / Conceptual / CoreAnimation_guide / Articles / Layers.html



最后,我记得刚刚读过这篇文章,它可能是一些帮助,因为我认为上面的解释并不那么方便 - 我告诉你什么,不是为什么 - 并且相信我,你需要知道为什么要正确地进入这种编程:



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



祝你好运!


I am slowly getting more serious about Core Animation and would greatly appreciate an explanation composed of short words spoken (typed?) slowly explaining CATransform3DIdentity and why the following code does what it does (flips the layer around in '3D' space)

    kFaceUpTransform = kFaceDownTransform = CATransform3DIdentity;
    // Construct a 180-degree rotation matrix:
    kFaceDownTransform.m11 = kFaceDownTransform.m33 = -1;

On second thought, type quickly and use multisyllabic words to your hearts content but please be gentle.

PS. I get the impression that I should become much more comfortable with linear algebra if I am to get much further with Animation...is this correct?

解决方案

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!

这篇关于我可以获得CATransform3DIdentity的基本解释吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆