Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: Page Curl

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2003
    Location
    beijing,China
    Posts
    4

    Page Curl

    Hello, Where can i find some code or algorithm introduction about page curl?
    I want to use OPENGL make a software FX.

  2. #2
    Super Moderator OpenGL Guru dorbie's Avatar
    Join Date
    Jul 2000
    Location
    Bay Area, CA, USA
    Posts
    3,941

    Re: Page Curl

    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.

  3. #3
    Advanced Member Frequent Contributor
    Join Date
    Apr 2000
    Location
    Adelaide, South Australia, Australia
    Posts
    765

    Re: Page Curl

    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.

  4. #4
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    2,411

    Re: Page Curl

    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!"

  5. #5
    Super Moderator OpenGL Guru dorbie's Avatar
    Join Date
    Jul 2000
    Location
    Bay Area, CA, USA
    Posts
    3,941

    Re: Page Curl

    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.

  6. #6
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    2,411

    Re: Page Curl

    > 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!"

  7. #7
    Advanced Member Frequent Contributor
    Join Date
    Apr 2000
    Location
    Adelaide, South Australia, Australia
    Posts
    765

    Re: Page Curl

    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.

  8. #8
    Junior Member Newbie
    Join Date
    Sep 2003
    Location
    beijing,China
    Posts
    4

    Re: Page Curl

    Originally 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]
    thanks, my question is how to create the mesh just like the right image warp operation.I used some hardware FX system,they
    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.

  9. #9
    Intern Contributor
    Join Date
    Jun 2001
    Location
    Montmagny, france
    Posts
    66

    Re: Page Curl

    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).]

  10. #10
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    The Round Table at Camelot
    Posts
    1,264

    Re: Page Curl

    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.
    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.


    -SirKnight
    -SirKnight

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •