I have rotate3d one image.. Here is my code..
CALayer *layer = backImageView.layer;
CATransform3D rotationAndPerspectiveTransform = CATransform3DIdentity;
rotationAndPerspectiveTransform.m34 = 1.0 / -300;
rotationAnd开发者_开发知识库PerspectiveTransform = CATransform3DRotate(rotationAndPerspectiveTransform, 15.0f * M_PI / 180.0f, 1.0f, 0.0f, 0.0f);
layer.transform = rotationAndPerspectiveTransform;
As before putting background image looks like
After
But when i put one more image as a background it looks like this..
X(-ve) - axis should not be displayed..
Is there any thing wrong in code or need to add extra logic or code ?
Thanks..
I had the same problem. Its happens becouse before rotation both images lay in the same plane, but after rotation part of the image appears behind the plane and covered by another. My solution was to drag one of the images on another plane, so they do not overlap.
grayImage.layer.transform=CATransform3DMakeTranslation(0, 0, -100);
Where grayImage your second image.
精彩评论