亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

在Android上實現頁面卷曲?

在Android上實現頁面卷曲?

莫回無 2019-10-25 14:43:22
我正在網上沖浪,尋找在Android上翻頁的良好效果,但似乎沒有。由于我正在學習平臺,因此能夠做到這一點似乎很不錯。我設法在這里找到一個頁面: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上實現它。那里的任何數學神都可以幫助我解決如何在Android Java中實現這一點。是否可以使用本機的繪圖API,我是否必須使用openGL?我可以以某種方式模仿行為嗎?任何幫助,將不勝感激。謝謝。
查看完整描述

3 回答

  • 3 回答
  • 0 關注
  • 602 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號