我正在網(wǎng)上沖浪,尋找在Android上翻頁的良好效果,但似乎沒有。由于我正在學(xué)習平臺,因此能夠做到這一點似乎很不錯。我設(shè)法在這里找到一個頁面:http : //wdnuon.blogspot.com/2010/05/implementing-ibooks-page-curling-using.html- (void)deform{ Vertex2f vi; // Current input vertex Vertex3f v1; // First stage of the deformation Vertex3f *vo; // Pointer to the finished vertexCGFloat R, r, beta; for (ushort ii = 0; ii < numVertices_; ii++) { // Get the current input vertex. vi = inputMesh_[ii]; // Radius of the circle circumscribed by vertex (vi.x, vi.y) around A on the x-y plane R = sqrt(vi.x * vi.x + pow(vi.y - A, 2)); // Now get the radius of the cone cross section intersected by our vertex in 3D space. r = R * sin(theta); // Angle subtended by arc |ST| on the cone cross section. beta = asin(vi.x / R) / sin(theta); // *** MAGIC!!! ***v1.x = r * sin(beta);v1.y = R + A - r * (1 - cos(beta)) * sin(theta); v1.z = r * (1 - cos(beta)) * cos(theta);// Apply a basic rotation transform around the y axis to rotate the curled page. // These two steps could be combined through simple substitution, but are left // separate to keep the math simple for debugging and illustrative purposes. vo = &outputMesh_[ii]; vo->x = (v1.x * cos(rho) - v1.z * sin(rho)); vo->y = v1.y; vo->z = (v1.x * sin(rho) + v1.z * cos(rho)); } }給出了iPhone的示例代碼(上面),但是我不知道如何在android上實現(xiàn)它。那里的任何數(shù)學(xué)神都可以幫助我解決如何在Android Java中實現(xiàn)這一點。是否可以使用本機的繪圖API,我是否必須使用openGL?我可以以某種方式模仿行為嗎?任何幫助,將不勝感激。謝謝。
- 3 回答
- 0 關(guān)注
- 406 瀏覽
添加回答
舉報
0/150
提交
取消