涉及到的技术点
catransform3drotate
转换坐标系
整体视图的层级结构
tvoscardview
cardimageview
cardparallaxview
转换坐标系的代码
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;
tvoscardanimation动画的运行结果
文/joycezhao(简书作者)
原文链接:http://www.jianshu.com/p/42770b5cee0d
著作权归作者所有,转载请联系作者获得授权,并标注“简书作者”。
如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!