问题描述
我想在我的iPhone应用程序中创建一个图像的页面卷曲动画。我的UIViewAnimationTransitionCurlUp,它的未记录的核心动画兄弟姐妹,但我需要动画的图像是一个透明的PNG,不均匀(一些alpha像素)轮廓。当使用上述预制转换时,这些alpha像素在动画开始时就会被绘成黑色,这看起来非常丑陋。
I'm trying to create a "page curl" animation of an image in my iPhone application. I t UIViewAnimationTransitionCurlUp, and it's undocumented Core Animation siblings, however the image I need to animate is a transparent PNG, with "uneven" (some alpha pixels) outlines. When using the aforementioned pre-made transition, those alpha pixels are painted black as soon as the animation starts, which looks terribly ugly.
因此,我试图创建一个Core我自己的动画。我试图研究的主题,但一直无法找到一个很好的概述所涉及的技术。实现当然必须比单个属性更改更复杂,我得到的感觉,即使CATransform3D将被限制为此目的,因为图像需要有不同的3D变换应用在它的不同部分 - 随着时间的变化。那么如何去讨论这个问题呢?非常感谢任何想法或想法。
Therefore, I seek to create a Core Animation of my own. I have tried to research the subject, but have been unable to find a good overview of the techniques involved. The implementation would of course have to be more complex than a single property change, I get the feeling that even CATransform3D would be to limited for this purpose, as the image needs to have different 3D transformations applied in different parts of it - changing over time. How would one then go about this subject? I'm very grateful for any thoughts or ideas!
Best,
Eli
Best,Eli
推荐答案
Corey指出,你可能需要使用OpenGL ES。核心动画展示了使用图层的能力,,但是所有层只是矩形,并且它们被操纵。您可以,但你想做的弯曲类型是比您可以使用Core Animation API管理更复杂。
As Corey points out, you'll probably need to go with OpenGL ES for this one. Core Animation exposes the ability to work with layers, even in 3-D, but all layers are just rectangles and they are manipulated as such. You can animate the flipping of a layer about an axis, even with a perspective distortion, but the kind of curving you want to do is more complex than you can manage using the Core Animation APIs.
您可以将图像拆分为一个小图层的网格,并使用CATransform3D操作每个图层这个弯曲效果,但在这一点上,你可能也使用OpenGL ES创建相同的效果。
You might be able to split your image up into a mesh of tiny layers and manipulate each using a CATransform3D to create this curving effect, but at that point you might as well be using OpenGL ES to create the same effect.
这篇关于如何创建自定义页面curl核心动画?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!