`
micc010
  • 浏览: 69228 次
  • 性别: Icon_minigender_1
  • 来自: 广西
社区版块
存档分类
最新评论
收藏列表
标题 标签 来源
pagecurl for ios ios
- (void)deform
{
  Vertex2f  vi;   // Current input vertex
  Vertex3f  v1;   // First stage of the deformation
  Vertex3f *vo;   // Pointer to the finished vertex
CGFloat 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 ios http://blog.sina.com.cn/s/blog_68444e230100srax.html
http://blog.sina.com.cn/s/blog_68444e230100srax.html
同步异步请求 ios http://www.open-open.com/lib/view/open1355055986679.html
http://www.open-open.com/lib/view/open1355055986679.html
xcode真机调试 ios http://kqwd.blog.163.com/blog/static/4122344820117191351263/
http://kqwd.blog.163.com/blog/static/4122344820117191351263/
Global site tag (gtag.js) - Google Analytics