1

Possible Duplicate:
How do I apply a perspective transform to a UIView?

How to change the perspective, 3D Transform, skew ,distortion, rotation of the image view? Any sample projects for this.Thanks in Advance

Community
  • 1
  • 1
Mani
  • 1,310
  • 1
  • 20
  • 40

1 Answers1

2

3D transforms, rotations, skews, etc are usually done with CATransform3D.

As per the documentation (Core Animation Programming Guide):

The CATransform3D data structure defines a homogenous three-dimensional transform (a 4 by 4 matrix of CGFloat values) that is used to rotate, scale, offset, skew, and apply perspective transformations to a layer.

As an example, to do a 3D rotation towards the bottom right, you would do something like:

myImageView.layer.transform = CATransform3DRotate(CATransform3DIdentity, 1.75, 0.85, 0, 0);

and don't forget to

#import <QuartzCore/QuartzCore.h>

A fantastic sample project is Mark Pospesel's Enter the Matrix. The code is on GitHub, also check out the explanatory slides.

Eric
  • 16,003
  • 15
  • 87
  • 139
  • Thanks a lot. EnterTheMatrix is the great App. Once again thanks for your guide lines. – Mani Sep 05 '12 at 07:32