0

Most of you should know the the cool EPGLTransitionView for flip paging store in the github repository:

https://github.com/epatel/EPGLTransitionView

It is done in opengl but it only works in one landscape direction.

Anyone knows or can give me a tip how can I implement easily the rest of devitation orientations?

thank you,

ThinkingStiff
  • 64,767
  • 30
  • 146
  • 239
raien
  • 65
  • 2
  • 9

1 Answers1

0

The EPGLTransitionView uses FlipTransitions to make the animations. Here the orientation is hardcoded, you need to change this to your current orientation device.

Overwrite the setupTransition method of FlipForward and FlipBackward classes:

- (void)setupTransition {
NSUInteger rotationFactor = 0;
UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
switch (orientation) {
    case UIInterfaceOrientationPortrait:
        rotationFactor = 0;
        break;
    case UIInterfaceOrientationLandscapeRight:
        rotationFactor = 90;
        break;
    case UIInterfaceOrientationPortraitUpsideDown:
        rotationFactor = 180;
        break;
    case UIInterfaceOrientationLandscapeLeft:
        rotationFactor = 270;
        break;
    default:
        break;
}
// Setup matrices
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glRotatef(rotationFactor, 0, 0, -1);
glFrustumf(-0.1, 0.1, -0.1333, 0.1333, 0.4, 100.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();    
glEnable(GL_CULL_FACE);
f = 0;}
atxe
  • 5,029
  • 2
  • 36
  • 50