|
Page Flip Effect |
SaintBass
Member #16,076
September 2015
|
Hi everyone, i'm programming a game and i need a "page flip effect" some idea?. |
pkrcel
Member #14,001
February 2012
|
Sorry but it's a bit vague, you mean like an animation of a page flipping while (I presume) the player is reading a book? (like in an rpg of sorts?) It is unlikely that Google shares your distaste for capitalism. - Derezo |
Mark Oates
Member #1,146
March 2001
|
Yea, maybe a bit more information? . There are a bunch of different ways to do a page flip animation. What kind of thing did you have in mind? -- |
SaintBass
Member #16,076
September 2015
|
The book is the creation of the heroe is something like this: http://pageflip-books.com/#meetpageflip/page/1 You can select the race, class, name and all the attributes of the heroe. |
Mark Oates
Member #1,146
March 2001
|
OK. What version of Allegro are you using? Allegro 5 or Allegro 4? -- |
SaintBass
Member #16,076
September 2015
|
Allegro 5 |
beoran
Member #12,636
March 2011
|
It's easy enough, I think, if you have your pages as bitmaps. Set up a clipping rectangle with void al_set_clipping_rectangle(int x, int y, int width, int height), then draw the page bitmap rotated with al_draw_rotated_bitmap(). You may need to use transformations (rotation and translation) to make the final result look good. |
Mark Oates
Member #1,146
March 2001
|
Probably the easiest way to achieve an effect like that is to use al_draw_scaled_bitmap(), and scale the bitmap horizontally. (Each page would be an ALLEGRO_BITMAP) It would give you rectangular shaped pages; without perspective. Here's a mock-animation of what it might look like: Probably the most elaborate way would be to setup a 3D projection and create a mesh of ALLEGRO_VERTEX that deforms like paper as you flip it. [edit: I don't know why the proportions on that gif are all messed up. hmm. something to do with the forum image embedding?] -- |
SaintBass
Member #16,076
September 2015
|
Thanks for the help guys i´m going to try the ALLEGRO_VERTEX Effect. |
|