Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/GlennChiu/GC3DFlipTransitionStyleSegue
iBooks-style 3D flip transition animation rendered in OpenGL ES 2.0 and wrapped in a UIStoryboardSegue subclass
https://github.com/GlennChiu/GC3DFlipTransitionStyleSegue
Last synced: 20 days ago
JSON representation
iBooks-style 3D flip transition animation rendered in OpenGL ES 2.0 and wrapped in a UIStoryboardSegue subclass
- Host: GitHub
- URL: https://github.com/GlennChiu/GC3DFlipTransitionStyleSegue
- Owner: GlennChiu
- Created: 2012-12-28T02:31:55.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-03-27T00:48:54.000Z (over 11 years ago)
- Last Synced: 2024-10-28T17:15:21.551Z (about 1 month ago)
- Language: Objective-C
- Size: 1.81 MB
- Stars: 513
- Watchers: 39
- Forks: 65
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome - GC3DFlipTransitionStyleSegue - iBooks-style 3D flip transition animation rendered in OpenGL ES 2.0 and wrapped in a UIStoryboardSegue subclass (etc)
- awesome - GC3DFlipTransitionStyleSegue - iBooks-style 3D flip transition animation rendered in OpenGL ES 2.0 and wrapped in a UIStoryboardSegue subclass (etc)
README
GC3DFlipTransitionStyleSegue
============================iBooks-style 3D flip transition animation rendered in OpenGL ES 2.0 and wrapped in a UIStoryboardSegue subclass.
Segue in action (complete clip can be found on [Youtube](http://youtu.be/Ps2F5kq30t4)):
![image](http://i.imgflip.com/boje.gif)
Comparison between iBooks and this segue class:
![image](https://dl.dropbox.com/u/10505256/Comparison.png)
Features / Design
-----------------
- Uses OpenGL ES rendering instead of Core Animation for high performance (60 fps) and shader effects.
- Uses GLKit to drastically reduce the amount of OpenGL ES 2.0 code (to write and maintain).
- Inspired by Apple's 3D flip view controller transition animation, as found in iOS apps like iBooks, iTunes U and Podcasts.
- Supports different screen sizes and screen orientations.
- Quick and easy setup. See [installation](https://github.com/GlennChiu/GC3DFlipTransitionStyleSegue#installation).Requirements
------------
GC3DFlipTransitionStyleSegue requires iOS 5.0 and above.Installation
------------
Add the source code to your project (and image file if you want to use it). Link your target against `QuartzCore.framework`, `GLKit.framework` and `OpenGLES.framework`.CocoaPods support: `pod 'GC3DFlipTransitionStyleSegue'`
If you use this class in a non-ARC project, make sure you add the -fobjc-arc compiler flag for the implementation file.
Quick setup: Just set this class as a custom segue and it'll work right away.
![image](https://dl.dropbox.com/u/10505256/SetCustomSegue.png)
Customization
-------------
To change the default texture on the side, change these macros:
```objectivec
#define IMAGE_NAME @"wood"
#define IMAGE_TYPE @"jpg"
```Exposed in the header file are some customization properties:
### - Depth
This property sets the depth (or thickness) of the 3D object.```objectivec
@property (assign, nonatomic) float depth
```**Discussion**
Depth value cannot be 0 (zero) as this will set the default value of 0.5 (`kGC3DFlipTransitionStyle_iBooks`). For a very small depth value use `kGC3DFlipTransitionStyle_Horizontal`.
There are three constant keys set in the header file:
```objectivec
extern float kGC3DFlipTransitionStyle_Horizontal
```Very small depth like Apple's transition style animation `UIModalTransitionStyleFlipHorizontal`. To see how it looks like, take a look at the [screenshot](https://github.com/GlennChiu/GC3DFlipTransitionStyleSegue#screenshots).
```objectivec
extern float kGC3DFlipTransitionStyle_iTunesU
```Depth value set like the iTunes U app (bit smaller than iBooks).
```objectivec
extern float kGC3DFlipTransitionStyle_iBooks
```Dept value set like the iBooks (and Podcasts) app. This is the default value.
### - disableLightEffect
This property disables the light effect.
```objectivec
@property (assign, nonatomic) BOOL disableLightEffect
```**Discussion**
Disabling the light effect allows the animation to mimic Apple's 3D flip transition animation. It does not have an effect on performance. Light effect is enabled by default.
To see how it looks like, take a look at the [screenshot](https://github.com/GlennChiu/GC3DFlipTransitionStyleSegue#screenshots).### - disableMultisampling
This property disables 4x multisampling anti-aliasing (4x MSAA).
```objectivec
@property (assign, nonatomic) BOOL disableMultisampling
```**Discussion**
Multisampling improves image quality. It is enabled by default. Disable it for slightly better performance on older devices.
### Example
This is an example on how to set the segue properties:
```objectivec
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue isKindOfClass:[GC3DFlipTransitionStyleSegue class]])
{
GC3DFlipTransitionStyleSegue *flipSegue = (GC3DFlipTransitionStyleSegue *)segue;
flipSegue.disableLightEffect = YES;
flipSegue.disableMultisampling = YES;
flipSegue.depth = kGC3DFlipTransitionStyle_iTunesU;
}
}
```### Screenshots:
![image](https://dl.dropbox.com/u/10505256/CustomizationEffects.png)
Todo
----
- Add option to flip view controllers in opposite direction like Apple's Podcasts app.
- Improve snapshot performance on the iPad.License
-------This code is distributed under the terms and conditions of the **zlib license**.
Copyright (c) 2013 Glenn Chiu
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.3. This notice may not be removed or altered from any source
distribution.