- Struct catransform3d
- {
- Cgfloat M11 (x scaling), M12 (Y shear), M13 (), m14 ();
- Cgfloat m21 (x shear), m22 (Y scaling), M23 (), M24 ();
- Cgfloat m31 (), M32 (), M33 (), m34 (perspective effect, the object to be operated must have a rotation angle, otherwise there is no effect. Of course, only the perspective effect can be obtained if there is a change in the z direction );
- Cgfloat M41 (X translation), M42 (Y translation), m43 (Z translation), m44 ();
- };
PS:
- When the overall ratio is changed, that is, when M11 = m22, if M33> 1, the overall image is reduced. If 0 <M33 <1, the overall image is enlarged. If M33 <0, A symmetric proportional transformation is performed on the origin.
- If you set M12 or m21, the shear effect is displayed. When you set [M12 = angle] and [m21 =-angle], the rotation effect is displayed. The two angles are the same.
- () Fill in the blank space.
- Also, to use catransform3d, you must import quartzcore. Framework in the project. Then in the file
# Import <quartzcore/catransform3d. h>.
IPhone perspective effect (Perspective)
- Catransform3d transform = catransform3didentity;
- Transform. m34= 0.0005 ;//
Pivoting Effect
- Transform = catransform3drotate (transform, (m_pi/180*40), 0, 1, 0 );
- [Piece. layer settransform: Transform];
The second line must be written before the third line.
From: http://www.buerguo.com/archives/162