General Algorithm concept of e-book page turning Effect

Source: Internet
Author: User

Today, I used eread8.0 (which can be used to read cartoons) to do a good job, that is, there are too many advertisements and many functional limitations. I don't like it very much.

The user experience of turning pages on eread is very good. Here I will give a general introduction to the algorithm ideas for implementing this effect.

 

Paging algorithm

Input: Four images of the same size (P1, P2, P3, P4) and the current coordinate of the mouse (x, y)

Output: merged flip image P

Algorithm steps:

(1) draw images P1, P4;

 

Triangle

 

Quadrilateral

(2) Calculate the part to be displayed in P3. This part may be a triangle or a quadrilateral and be drawn;

(3) Calculate the part to be displayed in P2. This part may be a triangle or quadrilateral. Perform the displacement and Rotation Processing before drawing and draw the part;

 

Note:

Currently, most advanced languages support partial display of images. As for image conversion, if the language itself does not support manual writing, you can refer to the textbook of the shape learning, so all the steps mentioned above are simple and feasible.

 

Page turning results advanced processing:

(1) The shadow effect, which can be recognized by the human eye, plays a very important role in light and shadow. In fact, Light and Shadow are just different in light and shade. This effect should be relatively simple to implement;

(2) page curvature. During page turning, P2 should be a curved surface. This part may be difficult to calculate. If the surface effect can be reasonably used, users can feel the feeling of entity books more realistically.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.