How to do image rotation as well as image 3DTransform?
<p>How to do image rotation(CGAffineTransformRotate) as well as image 3DTransform(CATransform3DRotate)? My problem is when I change the rotation and then make 3D Transform, Image goes to the initial image. Similarly when I change the 3D Transform after change the rotation goes to the initial image. I am using below code.</p>

<p>For Rotation :</p>

<pre><code>- (void)rotateImage:(UIRotationGestureRecognizer *)recognizer 
{
        self.transform = CGAffineTransformRotate(recognizer.view.transform, recognizer.rotation);
        recognizer.rotation = 0;
}
</code></pre>

<p>For 3D Transform :</p>

<pre><code>- (void)moveImage:(UIPanGestureRecognizer *)recognizer
{
        if ([recognizer respondsToSelector:@selector(translationInView:)]) {
            CGPoint translation = [(UIPanGestureRecognizer *)recognizer translationInView:recognizer.view.superview];
            self.xTranslation = translation.x;
            self.yTranslation = translation.y;

//            CALayer *layer = self.layer;
            CATransform3D rotationAndPerspectiveTransform = CATransform3DIdentity;
            rotationAndPerspectiveTransform.m34 = 1.0 / 500.0;
            rotationAndPerspectiveTransform = CATransform3DRotate(rotationAndPerspectiveTransform, - self.xTranslation / 50.0 * M_PI / 180.0f, 0.0f, 1.0f, 0.0f);
            self.layer.transform = rotationAndPerspectiveTransform;
            rotationAndPerspectiveTransform.m34 = - 1.0 / 500.0;
            rotationAndPerspectiveTransform = CATransform3DRotate(rotationAndPerspectiveTransform, - self.yTranslation / 50.0 * M_PI / 180.0f, 1.0f, 0.0f, 0.0f);
            self.layer.transform = rotationAndPerspectiveTransform;
    }
}
</code></pre>

<p>I want both rotation and 3D Transform. I am using UIPanGestureRecognizer for 3DTransform and UIRotationGestureRecognizer for rotation. How to do this? Thanks in advance. </p>
