This is when I wish I would have paid more attention in my math courses. By looking at some example code I have been able to make a cube using UIviews which I can swipe left and right. The following code is to rotate my views to the left. Here The UIviews are view and view2 below.
float rotation = (percent*90.0);
float fProject = (pc_width_page/2.0)*sinf(toRadians(rotation));
view.layer.transform = CATransform3DRotate(CATransform3DTranslate(t, 0.0, 0.0, -1.0*(fProject)), toRadians(rotation), 0.0, 1.0, 0.0);
view.center = CGPointMake((self.frame.size.width/2.0)+fProject, floorf(self.frame.size.height/2.0));
//View2
rotation = (percent*90.0)+90.0;
fProject = (pc_width_page/2.0)*sinf(toRadians(rotation));
view2.layer.transform = CATransform3DRotate(CATransform3DTranslate(t, 0.0, 0.0, -1.0*(fProject)), toRadians(rotation+180), 0.0, 1.0, 0.0);
view2.center = CGPointMake((self.frame.size.width/2.0)-fProject, floorf(self.frame.size.height/2.0));
Now my question is, what should I be modifying here to make the same animation but up or down instead of rotating them left. I have tried to change it myself as I understand that there is both a translation and a rotation being done to the layer but I am not getting the results I expect. Any help would be appreciated.