Question

Is any way make transforming like at the picture?

http://i.imgur.com/vOMqZ1e.png

Edit:

Now, for transformation I use next code:

    - (CATransform3D)carousel:(iCarousel *)carousel itemTransformForOffset:(CGFloat)offset baseTransform:(CATransform3D)transform {
   transform.m34 = - 0.0004;
   CGFloat clampedOffset = fmaxf(-1.0f, fminf(1.0f, offset));
   CGFloat x = (clampedOffset * 0.5f * _tilt + offset * _spacing) * kWidthView;
   CGFloat z = fabsf(clampedOffset) * - kWidthView * 0.5f;
   transform = CATransform3DTranslate(transform, x, 0.0f, z);
   return CATransform3DRotate(transform, -clampedOffset * M_PI_2 * _tilt, 0.0f, 1.0f, 0.0f);
}
Was it helpful?

Solution

Combining a perspective transformation with a rotation around the y (vertical) axis and applying that to the view's layer should give that effect, for example:

CATransform3D transform = CATransform3DIdentity;
transform.m34 = -1.0/200.0;
transform = CATransform3DRotate(transform, 45.0f * M_PI / 180.0f, 0.0f, 1.0f, 0.0f);
layer.transform = transform;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top