问题
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