Project Description


This project simulates the turning of pages in a book. The model was constructed in 2D and polygons and texture mapping was used to create pages. The model sits on a desk where it starts on the first page of a composition book. The user is able to use the mouse to turn the pages of the book from right to left, and left to right. The book is only a few pages long and consists of notes up until this quarter’s first midterm.

Project Design


Initially, there are two pages displayed. We can say these pages are page 1 and page 2. When the user drags the mouse across, either from right to left or left to right, the bottom corner of the page is flipped up. This is simply a polygon being drawn and scaled according to the two “hotspots.” These hotspots designate where the fold of the page is happening on the bottom (Hotspot 1) and left/right/top edge (Hotspot 2). When Hotspot 2 hits the upper corner of the page, a new vertex is added along the top page to the polygon being drawn.

When the corner of the page is being flipped up, there are now four polygons being displayed during the action, which correspond to four pages. In this case, pages 1, 2, 3, and 4 are now visible.


In order to keep track of these polygons, an STL vector was used to determine what page the user is currently on and this also helps to determine which pages to show. Using the STL vector, two pages are recorded when a page is completely turned to the other side. Going from right to left adds pushes two pages to the STL vector, while going from left to right pops two pages from the STL vector.


Texture mapping was used for each polygon to display notebook pages from my own personal CPE 471 notebook.


To keep track of which page you are on, the page numbers are outputted to the console.

Roadblocks


Some obstacles of this project were pertaining to adjusting the rate at which a hotspot was turning. Texture mapping also presented a challenge due to the change of polygon size. Also, constraints had to be created to ensure the user does not turn to a non existing page (from the first page, left to right, or the last page, going right to left).

Future Work


If time permitted, a lot more features could have been added to this project. Lines could be used to outline the pages when they are turning to give a more realistic feel. Also, the pages can be programmed to follow the mouse so that the page is not locked into the same motion. To give it an even more realistic feel, the pages can be implemented into individual cloth objects and physics can be involved as well. Doing so, the opportunity to integrate wind to create rapid page turning would be interesting or ripping pages out of the book. Lastly, if cloth was used, lighting and shading would give it a complete look.


Resources


http://www.codeproject.com/KB/GDI-plus/TurnThePage.aspx


Program 1 - STL Vector

Program 2 - Transformations

Lab 10 - Texture Mapping


- by Michael Young -