You ask:
How do I make the left side taller/stretched on flipping in, instead of making the right side smaller/stretched?
You also say that flipping out works fine but flipping in is wrong.
The difference between the two is in the sign of the perspective:
Flipping out code:
CATransform3D mt = CATransform3DIdentity;
mt.m34 = 1.0/1000; // note the lack of a minus sign
lr.transform = mt;
Flipping in code:
CATransform3D mt = CATransform3DIdentity;
mt.m34 = 1.0/-1000; // note the minus sign
lr.transform = mt;
If you want the two to look the same then they should most likely have the same perspective.
In my experience you usually want the negative perspective value (as you have done in the flipping in example). This has to do with the fact that the value represents the position of the "eye" / "camera" / "observer" or whatever you call it.
If you imagine a 3D scene where the position of the eye is (ex, ey, ez) then the perspective part of the transform is:
Assuming that you are looking at right at the world (i.e. not looking at it from the side) the position would be (0, 0, ez) which is the reason why we usually only set m34
(3rd column, 4th row) when adding perspective to a transform.
You can also see that this is how it is used in the Core Animation Programming Guide:
Listing 5-8 Adding a perspective transform to a parent layer
CATransform3D perspective = CATransform3DIdentity; perspective.m34 = -1.0/eyePosition;
If the rotation looks wrong to you should probably rotate in the other direction (for example changing a rotation from 0 to π into a rotation from 0 to -π or the other way around: changing a rotation from π to 0 into a rotation from -π to 0.