x轴旋转:
CABasicAnimation *theAnimation;
theAnimation=[CABasicAnimation animationWithKeyPath:@"transform.rotation.x"];
theAnimation.duration=1;
theAnimation.fromValue = [NSNumber numberWithFloat:0];
theAnimation.toValue = [NSNumber numberWithFloat:3.1415926];
 [yourView.layer addAnimation:theAnimation forKey:@"animateTransformx"];

y轴旋转:
CABasicAnimation *theAnimation;
theAnimation=[CABasicAnimation animationWithKeyPath:@"transform.rotation.y"];
theAnimation.duration=1;
theAnimation.fromValue = [NSNumber numberWithFloat:0];
theAnimation.toValue = [NSNumber numberWithFloat:3.1415926];
 [yourView.layer addAnimation:theAnimation forKey:@"animateTransformy"];

z轴旋转:
CABasicAnimation *theAnimation;
theAnimation=[CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
theAnimation.duration=1;
theAnimation.fromValue = [NSNumber numberWithFloat:0];
theAnimation.toValue = [NSNumber numberWithFloat:3.1415926];
 [yourView.layer addAnimation:theAnimation forKey:@"animateTransformz"];

以上缩放是以view的中心点为中心缩放的,如果需要自定义缩放点,可以设置卯点:
//中心点
[yourView.layer setAnchorPoint:CGPointMake(0.5, 0.5)];

//左上角
[yourView.layer setAnchorPoint:CGPointMake(0, 0)];

//右下角
[yourView.layer setAnchorPoint:CGPointMake(1, 1)];

可设参数:
theAnimation.repeatCount = 5;
theAnimation.autoreverses = YES;
theAnimation.removedOnCompletion = YES;

转载于:https://www.cnblogs.com/417460188dy/p/4470481.html

CABasicAnimation x y z 轴旋转动画相关推荐

  1. glut 实现 horse.off 和colorcube的绘画以及按X,Y,Z轴旋转,放大缩小,上下移动图像的功能

    一.问题描述: 模型显示:从给定的off文件(ftp//Models/cube.off.horse.off)读入网格模型的顶点位置和面,显示在屏幕上 观察:(1) 上下左右方向键移动模型:       ...

  2. unity 里让一个物体围绕x,y,z轴旋转起来。

    如何 在unity 里让一个物体围绕x,y,z轴旋转起来? 先看下效果:  如何 在unity 里让一个物体围绕x轴旋转起来?答案揭晓: 实现代码: using System.Collections; ...

  3. Unity控制物体沿x、y、z轴旋转

    普通旋转 using System.Collections; using System.Collections.Generic; using UnityEngine;public class Rota ...

  4. 18.外部相机校准——旋转(Rotation),R是什么样子的,绕Z轴旋转的例子,齐次坐标旋转_2

    目录 旋转(rotation) R是什么样子的 绕Z轴旋转的例子 齐次坐标旋转 旋转(rotation) 现在生活变得更加丑陋,旋转(rotation).我这里有一个图,或者我想这也是来自四边复合幻灯 ...

  5. matlab线旋转成面,用matlab怎么绘制一条曲线绕z轴旋转生成的曲面?

    用matlab怎么绘制一条曲线绕z轴旋转生成的曲面? 已知数据如下: x z y -398.10815554637100 391.8559758318630 690.066133543041 -381 ...

  6. three.js orbitcontrol更改绕x轴与z轴旋转

    我们在threejs模型中可以引入orbitcontrol来控制模型交互动作,但orbitcontrol默认是以y轴为正向上轴,即旋转的时候绕x轴和y轴旋转 但我现在想让绕x轴和z轴旋转,方法是 ca ...

  7. 直线绕z轴旋转所成曲面的方程

    直线:(x-x0)/L=(y-y0)/M=(z-z0)/N绕z轴旋转所成曲面的方程为: x2+y2=α+β(z-z0)+γ(z-z0)2 其中 α=x02+y02 β=(2/N)(Lx0+My0) γ ...

  8. 车削加工编程一般包含X和Z坐标运动及绕Z轴旋转的转角坐标

    车削加工编程一般包含X和Z坐标运动及绕Z轴旋转的转角坐标C .­ (1)快速定位(G00或G0) 刀具以点位控制方式从当前所在位置快速移动到指令给出的目标位置.­ 指令格式:G00 X(U) Z(W) ...

  9. Android X轴Y轴Z轴旋转

    Android中并没有提供直接做3D翻转的动画,所以关于3D翻转的动画效果需要我们自己实现,一个简单的办法就是重写Animation.这里只是以Y轴旋转进行下说明,至于X轴.Z轴和Y轴的原理是一样的. ...

最新文章

  1. 微信环境中如何实现下载apk文件的下载
  2. 基于消息队列 RocketMQ 的大型分布式应用上云最佳实践
  3. python堆排序算法_python 排序 堆排序
  4. 《算法小白历险记》3.最长公共前缀【python-简单】
  5. 云原生时代,阿里云联手博睿数据让IT运维可观测更智能
  6. 帆软独家:数字化转型打造企业数据战斗力
  7. 网页制作表单代码java_网页制作的40个经典代码
  8. 基于华为云的一个典型的持续部署方案
  9. 计算机最低分怎么英语,编写一个学生类 有年龄 英语、数学、计算机三门成绩 求平均分、最高分、最低分...
  10. 【蓝桥杯】2019:最长子序列
  11. 分水岭算法(Watershed Algorithm)
  12. 毕设题目:Matlab图像去噪
  13. c语言入门手机自学软件,C语言入门学习
  14. JN5169 NXP ZigBee PRO 无线网络应用所需的常见操作(二)
  15. 虚拟化是什么,虚拟化技术分类
  16. 豆瓣高分电影爬取项目,思路清晰,易上手,附免费代码下载
  17. 凤凰x86 卡android,卡ANDROIDx86_64的解决办法
  18. python基础logging 压缩、根据指定文件夹并进行删除
  19. 最新上海个人养老保险缴费信息查询步骤
  20. 多台计算机共享内存_共享内存多处理器和指令执行| 计算机架构

热门文章

  1. 怎么判断日出时间早晚_云南8日游攻略以及费用,从西安到云南旅游怎么安排行程?...
  2. 思科网络基础课件_上海思科CCNA培训、思科网络工程师培训
  3. python精通难_Python 为什么入门容易 精通难
  4. winform 实现qq代理_会一百种引流方法,还不如会用一个QQ引流群控
  5. linux设置静态IP及克隆后修改IP和hostname
  6. MySQL中清空表和截断表的区别(新手入门.)
  7. php mysql第4版高清_PHP和MySQL WEB开发(中文高清第4版)
  8. js 引用 java常量_java调用JS 与JS 调java
  9. amd核芯显卡控制面板自定义分辨率_锐炬Xe核芯显卡之我见:创造属于英特尔自己的强大...
  10. 嘉兴学院计算机专业最低录取分,嘉兴学院南湖学院计算机类专业2015年在广西理科高考录取最低分数线...