当前位置:首页 > 通信资讯 > 正文

ios切换动画效果(ios3d模型动画)

涉及到的技术点

  1. CATransform3DRotate
  2. 转换坐标系

整体视图的层级结构

  1. tvOSCardView
  2. cardImageView
  3. cardParallaxView

转换坐标系的代码

?
1 2 3 4 5 6 7 8 CGFloat xFactor = MIN(1, MAX(-1, (touchPoint.x - (self.bounds.size.width / 2)) / (self.bounds.size.width / 2))); CGFloat yFactor = MIN(1, MAX(-1, (touchPoint.y - (self.bounds.size.height / 2)) / (self.bounds.size.height / 2))); cardImageView.layer.transform = [self transformWithM34:1.0 / -500 xf:xFactor yf:yFactor]; cardParallaxView.layer.transform = [self transformWithM34:1.0 / -250 xf:xFactor yf:yFactor]; CGFloat zFactor = 180 * atan(yFactor / xFactor) / M_PI + 90; <br>

ios切换动画效果(ios3d模型动画)

tvOSCardAnimation动画的运行结果

文/JoyceZhao(简书作者)
原文链接:http://www.jianshu.com/p/42770b5cee0d
著作权归作者所有,转载请联系作者获得授权,并标注“简书作者”。

如果您对该产品感兴趣,请填写办理(客服微信:xiaoxiongyidong)

为您推荐:

发表评论

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。