Hello, Where can i find some code or algorithm introduction about page curl?
I want to use OPENGL make a software FX.
Hello, Where can i find some code or algorithm introduction about page curl?
I want to use OPENGL make a software FX.
This should really be in the beginners section.
Effects like this tend to load two images as two textures. The new image is drawn to the screen on a simple quad then the old image is drawn on a geometry mesh on top.
The mesh is then animated to look like a turning page and it looks like the perfect image warp operation for the page curl.
To get the basics working you need to understand OpenGL animation with the doublebuffer, OpenGL texturing, and the generic graphics concept of the "painters algorithm".
Bonus points for:
Z buffering to avoid self occlusion of the old page.
Lighting on the curl mesh with surface normals.
Shadows cast from the old page onto the new.
Any other fancy effect you can come up with, like bump mapping, transparency etc.
ah, but the REAL trick (to add to the "bons points section") is how to animate the page so it isn't just a "simple quad" undergoing a rigid rotatation.... and solving that is solving something akin to cloth animation insofar as you pick up a corner and it pulls adjacent verticies as a function of the page-space distance, etc.
That's an artist problem. Poor programmer just plays the animation he's handed :-)
"If you can't afford to do something right,
you'd better make sure you can afford to do it wrong!"
You don't get bonus points for that, it should be in version 1.0 or you get an fail, the thread is page *curl*, that's why I put the background on a simple quad and the foreground on a mesh.
Evaluators could make this easier for you or you could code it but it shouldn't take an artist for a simple curl deformation on a mesh.
> it shouldn't take an artist for a simple > curl deformation on a mesh
If the only effect you're interested in is
a single page curl, then that's true.
I'm drawing the conclusion that if you want
a curl, you probably are going to end up
wanting 102 other effects as well. At that
point, using a data driven approach with
artists generating the data is what you want
to be doing.
Personally, I think that the phletora of
tutorials on the web (and in books) that show
people how to draw using hard-coded data are
doing a dis-service. While you have to start
somewhere, I think that starting at vertex
arrays is the right thing, and then mention
that vertex arrays are typically loaded from
data files.
Anyway.
"If you can't afford to do something right,
you'd better make sure you can afford to do it wrong!"
well, a simple quad isn't a quad mesh, is it? you can't animate a page wrinkling and curling with *A* *SIMPLE* quad. You need lots of them; probably in a strip, too.
also, since when has all animation been replay back what an artist gives you? that's like... well, there's no fun in that, is there?
I realise that making a page curl isn't hard, but the description of a "simple quad" turning makes it sound as though you're advocating something extremely trivial. Meh.
thanks, my question is how to create the mesh just like the right image warp operation.I used some hardware FX system,theyOriginally posted by dorbie:
[B]The mesh is then animated to look like a turning page and it looks like the perfect image warp operation for the page curl.
B]
control page curl through some parameters like radius, angle, offst,etc. I need a algorithm use this parameters to create a correct mesh.the page curl must under my control.
A single patch where vertices near the bottom-right corner can have their positions tranformed by a a simple formula can perhaps to be a good start ?
[This message has been edited by cyclone (edited 09-05-2003).]
He didn't say you would curl the simple quad, but the mesh on top of the quad. Actually, why would you need the quad in the first place? Why not just have a mesh with the texture on it and bend that up? Well...I guess you can use the background quad for a background image or something. Like in PSP for example, when you do a page curl, the part behind the curl is like a grey, or whatever you choose (if I remember correctly). Maybe that's where the quad comes in, is to draw that part.well, a simple quad isn't a quad mesh, is it? you can't animate a page wrinkling and curling with *A* *SIMPLE* quad. You need lots of them; probably in a strip, too.
-SirKnight
-SirKnight