本文介绍了CATransform3D vs.CGAffineTransform?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这两者之间的区别是什么?

Whats the difference between the two?

我确定他们有利弊,他们是更好的表现。

I'm sure they have pros and cons, and situations they are better performers in.

比较两者的任何资源?

Any resources that compare the two?

是一个更好的动画(我想象CATransform3D)?为什么?

Is one better for animation (I imagine the CATransform3D)? Why?

同样,我认为我读的文字清晰度可能是一个问题,是一个更好的缩放文本吗?

Also I think I read somewhere that text clarity can be an issue, is one better at scaling text?

推荐答案

MSN说,它们用于不同的情况。 CGAffineTransform用于对NSViews,UIViews和其他2-D核心图形元素进行2-D操作。

As MSN said, they are used in different cases. CGAffineTransform is used for 2-D manipulation of NSViews, UIViews, and other 2-D Core Graphics elements.

CATransform3D是一个Core Animation结构,可以对CALayers执行更复杂的三维操作。 CATransform3D具有与OpenGL模型视图矩阵相同的内部结构,当您意识到Core Animation是基于OpenGL(CALayers是OpenGL纹理的包装器等)时是有意义的。我发现这种内部结构的相似性,加上一些好的帮助函数,苹果提供,可以让你做一些整洁的OpenGL优化,因为我发布。

CATransform3D is a Core Animation structure that can do more complex 3-D manipulations of CALayers. CATransform3D has the same internal structure as an OpenGL model view matrix, which makes sense when you realize that Core Animation is built on OpenGL (CALayers are wrappers for OpenGL textures, etc.). I've found that this similarity of internal structure, combined with some nice helper functions that Apple provides, can let you do some neat OpenGL optimizations, as I post here.

如果要直接在2-D空间(CGAffineTransform)或3-D(CATransform3D)中的底层Core Animation层处理视图。我使用CATransform3D更频繁,但这是因为我花了很多时间与Core动画。

When it comes down to choosing which do use, ask yourself if you're going to work with views directly in a 2-D space (CGAffineTransform) or with the underlying Core Animation layers in 3-D (CATransform3D). I use CATransform3D more frequently, but that's because I spend a lot of time with Core Animation.

这篇关于CATransform3D vs.CGAffineTransform?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 18:24