It's possible to create custom transform matrices. But I wonder if they are suited for making water ripple effects on a CALAyer. Think of 20 of them in an animation. Can someone tell?
可以创建自定义变换矩阵。但我想知道它们是否适合在CALAyer上制作水波纹效果。想想动画中的20个。有人能说出来吗?
1 个解决方案
#1
A CALayer is a single rectangular texture. Given that Core Image filters are unavailable for the iPhone (which let you do water ripple effects on the Mac), you won't be able to produce the effect you're looking for with a single CALayer. However, you might be able to tile a set of CALayers and apply appropriate 3-D transforms to each to translate and rotate them into a shape mimicking a water ripple.
CALayer是单个矩形纹理。鉴于iPhone的Core Image滤镜不可用(这可以让你在Mac上进行水波纹效果),你将无法使用单个CALayer产生你想要的效果。但是,您可以平铺一组CALayers并对每个进行适当的三维变换,以将其平移并旋转成模仿水波纹的形状。
For more on the math involved, you may wish to refer to this question.
有关所涉及的数学的更多信息,您可能希望参考这个问题。
#1
A CALayer is a single rectangular texture. Given that Core Image filters are unavailable for the iPhone (which let you do water ripple effects on the Mac), you won't be able to produce the effect you're looking for with a single CALayer. However, you might be able to tile a set of CALayers and apply appropriate 3-D transforms to each to translate and rotate them into a shape mimicking a water ripple.
CALayer是单个矩形纹理。鉴于iPhone的Core Image滤镜不可用(这可以让你在Mac上进行水波纹效果),你将无法使用单个CALayer产生你想要的效果。但是,您可以平铺一组CALayers并对每个进行适当的三维变换,以将其平移并旋转成模仿水波纹的形状。
For more on the math involved, you may wish to refer to this question.
有关所涉及的数学的更多信息,您可能希望参考这个问题。