2011-11-28 94 views
0

如果要使用核心动画旋转对象(以弧度为单位),请在z轴中使用以下哪些图层的CATransform3D矩阵的关键路径? (超过1个选项可以正确)。CATransForm3D矩阵问题

  1. 旋转
  2. rotation.xy
  3. rotation.x
  4. rotation.y
  5. rotation.z

回答

1

不是你给的选项完全清楚,但我用下面的代码做旋转:

[[_yourView layer] setAnchorPoint:CGPointMake(0.0f, 0.5)]; 
[UIView animateWithDuration:1.0f 
         delay:0.0f 
        options:UIViewAnimationCurveEaseInOut 
       animations:^{ 
        CATransform3D rotation = CATransform3DIdentity; 
        rotation.m34 = 1.0f/-300.0f; 
        rotation = CATransform3DRotate(rotation, -60.0f * M_PI/180.0f, 0.0f, 1.0f, 0.0f); 
        [[_yourView layer] setTransform:rotation]; 
       } 
       completion:nil]; 

它在Y轴(旋转的话,认为将改变

旋转= CATransform3DRotate(旋转,-60.0f * M_PI/180.0f,0.0F1.0F:z方向),则可以通过设置以下PARAMS为其他轴线的旋转0.0F);

0

以上。使用transform.rotation.z