Fish Eye Effect With Core Animation?

偶尔善良 提交于 2019-12-12 21:16:03

问题


I am trying to achieve an effect similar to the globe of the ABC News iPad app. (Google Images Examples)

Is it possible to get this effect by transforming CALayers? Or is this using OpenGL and fragment/vertex shaders?

CALayer provides access to the transformation matrix, is there some math that can be applied to this rather than transforming the OGL model view matrix? Feels like OGL is the more complicated way to do this and that there should be an easier solution.

If anyone has some ideas it is much appreciated. Thanks!


回答1:


No matter what you do to the transformation matrix, a CALayer will always remain a flat surface. That's why Apple likes to call Core Animation "2.5D" (2D objects in 3D space). You might be able to arrange multiple layers so that they form a sphere but then you cannot map a texture across all layers at once.



来源:https://stackoverflow.com/questions/3790238/fish-eye-effect-with-core-animation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!