Tutorial
FM4, S6E2DH/S6E2DF/S6E2D5/S6E2D3 Series, 32-Bit Microcontroller, Graphic Driver User Manual, Doc. No. 002-04387 Rev. *A
62
6.10 Tutorial: Cover Flow
6.10.1 Summary
This example demonstrates several Pixel Engine features in form of a cover flow. Source code:
04_sample/basic_graphics/coverflow/.
Figure 28. coverflow
6.10.2 Usage
Use the "right" button to switch between circle and perspective mode.
6.10.2.1 Learning Goals
The following techniques and features are used:
Work with matrices
z-order sorting
The focus in this tutorial is not the initialization nor the double buffer technique.
6.10.2.2 Matrix Calculation
The driver supports an 3
∗
2 matrix. It allows to translate, rotate, scale and share an bitmap.
However to simplify the development task we decide to make the matrix calculation with a 4
∗
4 matrix first. This is a
matrix format that is well documented because it is used for many OpenGL applications.
A matrix calculation like this for the circle mode can be the following. Please note:
It is easier to read the matrix operation from bottom to top.
For each cover (bitmap) we need a separate matrix.
/* Start with the pre matrix */
/* Load identity matrix */
utMat4x4LoadIdentity(m_m44Pre);
/* Scale the dimension 0..2 to screen dimension */
utMat4x4Scale(m_m44Pre, GetWidth() / 2.0f, GetHeight() / 2.0f, 1);
/* Move the window from 0, 0 to 1, 1 coordinates */