How to make image rotation and 3D transform simultaneously?
<p>I am working on image editing application(resize, rotation, 3d transform). If I am rotate the image and then make 3D transform. Its going to initial image. Otherwise I am change the 3D transform then make rotation, Its also goes to the initial state. </p>

<p>For image 3D Transform I am using below code : </p>

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

            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);
            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);
            layer.transform = rotationAndPerspectiveTransform;
        }
 }
</code></pre>

<p>For image Rotation I am using below code : </p>

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

<p>How to I fix this issue. Always welcome your suggestions, sample code, Sample project, any App store applications. Thanks in advance. Any one help me.  </p>
