PageFlip


Start of a page turning system. This one is very much wip in progress, it works but there is room for improvement. This is based on an action script page turn effect and has some limitations so I will be adding a new page flip effect soon which will offer a much nicer turn effect and wont have the side effect of flattening the mesh. To make best use of this script you should a MegaShape page mesh as your base.

Info

Be sure to check the Build a Book section out below for a complete system to build a book, add pages and have it animate with a simple slider. Also look at the Page Mesh section on how to use the MegaShape Page Mesh to create pages with user defined number of vertices to get a nice smooth turn.

Page Flip Param Description

Turn

Amount the page is turned from right to left 0 – 100.

Ap1

Amount of curl early on in the turn.

Ap2

Amount of curl mid way through turn.

Ap3

Amount of curl at end of the turn.

Flip X

Use this if page turns from wrong edge.

Advanced

If you click Advanced a load of extra params open, you can use these to control the whole effect but each param is basically a coefficient in the maths that control the page turn so it is very much a case of trail an error but if you are feeling brave have a play. The new page turn modifier will be much nicer.

Page Flip Class

public class MegaPageFlip : MegaModifier
{
    public bool     animT;
    public bool     autoMode;
    public bool     lockRho;
    public bool     lockTheta;
    public float    timeStep;
    public float    rho;
    public float    theta;
    public float    deltaT;
    public float    kT;
    public float    turn;
    public float    ap1;
    public float    ap2;
    public float    ap3;
    public bool     flipx;

Build a Book Script

There is a script include in the extras section that make is easy to build a complete book by allowing you to say how many pages are in the book and a texture for each page, the books can then be controlled with a single value that will open the book and turn each page until it closes the book.

Video showing the Build Book process

3 Comments

  • fanxu1218

    1

    Hello,my name is silent,I am chinese,english is not good,l don't know how to use this scripts,so can you give me a demo,my Email is fanxu1218@hotmail.com,thank you very much.

  • spookycat

    2

    Hi There, the best way to learn how to use the PageFlip would be to look at the MegaBook.cs source code and view the video above (fixed the broken link)

  • fanxu1218

    3

    I am in china ,I can't watch the youtube.

You must be logged in to post a comment.