epatel / EPGLTransitionView

OpenGL ES view for animating a view transition.
http://www.memention.com/blog/2010/02/28/Bells-and-Whistles.html
393 stars 68 forks source link

Add Up and Down transition #4

Open jorbsd opened 13 years ago

jorbsd commented 13 years ago

In addition to the left and right transitions it would be great to have up and down transitions in the samples that come with the code.

saiy2k commented 12 years ago

In the drawTransitionFrameWithTextureFrom:(GLuint)textureFromView textureTo:(GLuint)textureToView method of DemoTransition2.m, change the vertices and texcoords to the following for vertical transition:]

GLfloat vertices[] = {
    -1, 1.5,
    -1, 0,
    1,  1.5,
    1,  0,
    -1, 0,
    -1, -1.5,
    1, 0,
    1, -1.5,
};

GLfloat texcoords[] = {
    0, 0,
    0, 0.5,
    1, 0,
    1, 0.5,
    0, 0.5,
    0, 1,
    1, 0.5,
    1, 1,
};

also find the lines: glRotatef(v*180.0, 0, 1, 0); glRotatef(180.0, 0, 1, 0);

and replace them with glRotatef(v*180.0, 1, 0, 0); glRotatef(180.0, 1, 0, 0);

priteshshah1983 commented 12 years ago

How do I change the reference line for rotation to the top of the screen (instead of the center) to achieve a Rolodex like animation?

epatel commented 12 years ago

Actually I think EPGLTransition might be overkill for "flat panel" animations. Best for that would be using CALayers efficiently. i.e. see http://www.voyce.com/index.php/2010/04/10/creating-an-ipad-flip-clock-with-core-animation/ EPGLTransition is better if one would like to do "non-flat panel" animations, like a page curl, curtain cloth etc

priteshshah1983 commented 12 years ago

Thanks for your help Edward! I'll give it a try.