6 ms·
Apple's iBooks Dynamic Page Curl
- frankus 17y agoI haven't looked at the code yet, but I've been curious how they do this. I am not a mathematician, but my understanding is that the affine transform only lets you scale, rotate, and skew the whole image at a time. Is the page curl effect some kind of custom non-affine transform? Or am I missing a simple way to do this using a single linear transformation?
- BigZaphod 17y agoIt looks like it's just an undocumented Core Image filter applied to the layer.
- windsurfer 17y agoCan't you get banned from the application store if you use undocumented ipod features?
- allenbrunson 17y agoNot if you're Apple, and this is Apple's app that the author is talking about.
- glhaynes 17y agoSo far, all of the Apple apps on the App Store seem to abide by "the rules". I hope that continues.
- cubicle67 17y agoYou don't get banned, but your app may be withdrawn until the private API calls are removed
- BigZaphod 17y agoUsually the app just gets rejected if someone uses an undocumented feature. Jailbreakers or people developing just for fun or using the adhoc or (I think) corporate deployment method don't go through the approval process and therefore can't get banned/rejected. So for people in those situations, it's fun to know how to do it.
- samlittlewood 17y agoYou are right[1], and there won't be a single linear transform. This page curl will almost certainly be a piecewise linear approximation using a triangle mesh whose vertices are animated according to the user input. 1. The GPU will also support projective transforms - but that won't help here.
- DLWormwood 17y ago> This page curl will almost certainly be a piecewise linear approximation using a triangle mesh whose vertices are animated according to the user input. I honestly can't tell if your being facetious here or not. There are certainly much simpler ways of pulling off this effect; ask any Demoscene participant.
- wtallis 17y agoSimpler in what way? Demoscene code is seldom simple to read or write, and usually doesn't take advantage of hardware acceleration. When I think demoscene, I think of getting crazy effects through esoteric bit manipulations. When you're already shipping OpenGL and your whole UI is composited with that, the easiest option is probably just texture mapping on to a low-resolution mesh.
- hexley 17y agoFinally, a voice of clarity.
- blasdel 17y agoPlease stop implementing page curls, especially for reflowable unpaginated text, especially if you're not using flash and have rich text layout support (as you do in Cocoa). Please do this instead: http://amarsagoo.info/tofu/ http://amarsagoo.info/tofu/
- BigZaphod 17y agoThe rich text situation is somewhat different on the iPhone than it is on OSX/Cocoa. There is no NSTextView, for instance. The only "easy" rich text solution on iPhoneOS is a UIWebView - which isn't exactly cheap in terms of CPU utilization. Ironically, a visual effect such as a page curl is likely far cheaper due to the GPU support than reflowing a bunch of rich text.
- pieter 17y agoI think that's changing in the iPad SDK
- DLWormwood 17y agoJust to clarify the above comment, there is a UITextView, but it's one typeface/size only.
- BigZaphod 17y agoMy comment was referring to NSTextView which is present in OSX/Cocoa. NSTextView is extremely powerful and feature-rich. UITextView is.... not so much, of course. :)
- Tichy 17y agoI wonder how long the page curl meme will stay around. Movies are still being identified by the analog movie strip image, but will it still be the case in 10 years?
- derefr 17y agoI think they will, simply because they need to look like something. It wouldn't really help you navigate your OS if everything was represented by glowing rectangles†, would it? † http://www.theonion.com/content/news/report_90_of_waking_hours_spent http://www.theonion.com/content/news/report_90_of_waking_hou...