I've been studying openGL for a while, I'd like to create a book with the page turning effect, but the pages should "bend" themselves. So now I'm wondering how one could bend a surface and animate it in openGL. Sounds like a multiple-per-vertex-shaders depending on the position of the vertex, isn't it?
Or perhaps a single shader with multiple branches
Page turning is implemented as a cone that varies its radius and apex angle at various stages of the "curl". Here is a tutorial for iOS that walks through the math. The original paper by Xerox PARC is here.
Hope this helps!
Implement the bending as a curve equation, and apply that curve to the vertex position depending on the distance from the binding (you may use an additional vertex attibute for this).
If look at a cone you can see, that it consists of a circular curve (around its axis) which is tapered to its tip. This is the curve you'd create for a cone method page curl effect. The surface of a cone with its tip at the origin and its axis being Z is described by the analytic surface
S(u,v) = (x*cos(u*2*pi) + y*sin(u*2*pi))*v + z*v*a
where x,y,z are the cartesian unit vectors and a = 2*tan(opening angle)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With