I am wondering if it is possible to take an image view and turn it on the z-axis so that the left side appears closer to the user viewing the application and the right side gets narrower as if it was getting farther away. I was thinking of doing this with OpenGL, but was hoping it could be done with Core Animations. Has anyone had any experience with this?
UIImageView *front = [[UIImageView alloc] init];
UIImageView *left = [[UIImageView alloc] init];
float trialSide = 30 * 5.7;
front.frame = CGRectMake(180, 280, 360, 295);
front.image = [img croppedImage:CGRectMake(trialSide, trialSide, imgWidth - (trialSide *2), imgHeight - (trialSide * 2))];
left.frame = CGRectMake(149, 280, 30, 295);
left.image = [img croppedImage:CGRectMake(0, trialSide, trialSide, imgHeight - (trialSide * 2))];
[self.view addSubview:front];
[self.view addSubview:left];
CALayer *layer = front.layer;
CATransform3D rotationAndPerspectiveTransform = CATransform3DIdentity;
rotationAndPerspectiveTransform.m34 = 1.0 / -1000;
front.frame = CGRectMake(180, 280, 360, 295);
rotationAndPerspectiveTransform = CATransform3DRotate(rotationAndPerspectiveTransform, 30.0f * M_PI / 180.0f, 0.0f, 1.0f, 0.0f);
layer.transform = rotationAndPerspectiveTransform;
[self.view layoutSubviews];