如何围绕某一轴(不是xyz)旋转——transform.RotateAround
2017-10-31 01:41
801 查看
Rotate是围绕轴来旋转,在正交模式下,呈现水平直线,如何实现围绕设定旋转?需要用到RotateAround方法。
首先设定轴:public GameObject axis;
public float rotateSpeed;
然后在update中,加入一行代码:this.transform.RotateAround (axis.transform.position, axis.transform.up,rotateSpeed);
注意:然而效果是物体垂直于轴旋转的!
参考原文:http://www.cnblogs.com/hehaiyang/p/4333841.html
首先设定轴:public GameObject axis;
public float rotateSpeed;
然后在update中,加入一行代码:this.transform.RotateAround (axis.transform.position, axis.transform.up,rotateSpeed);
注意:然而效果是物体垂直于轴旋转的!
参考原文:http://www.cnblogs.com/hehaiyang/p/4333841.html
相关文章推荐
- 如何通过js获取到CSS3里面transform rotate旋转角度的度数,matrix解析
- 如何通过js获取到CSS3里面transform rotate旋转角度的度数,matrix解析
- Transform类 RotateAround() 太阳、地球、月亮围绕旋转
- unity之RotateAround 一个物体围绕另外一个物体旋转
- transform:rotate()将元素进行不同角度的旋转
- Js新手问题: transform: rotate(N deg) 每次只旋转一次的问题
- 如何旋转rotate UIImage
- iOS7、iOS8中的CGAffineTransformRotate、view的旋转方向问题
- unity3d学习之Rotate和RotateAround做地球绕太阳旋转
- CSS3属性transform详解之(旋转:rotate,缩放:scale,倾斜:skew,移动:translate)
- CSS3属性transform详解之(旋转:rotate,缩放:scale,倾斜:skew,移动:translate)
- Transform.RotateAround
- 旋转动画(RotateTransform)
- Flex中如何利用Matrix类的rotate函数对图片进行旋转操作的例子
- Android如何实现3D旋转,我只要旋转,而不是旋转动画
- CSS3属性transform详解之(旋转:rotate,缩放:scale,倾斜:skew,移动:translate)
- CSS3 transform:rotate(deg) 2D旋转效果
- CSS3 transform rotate(旋转)锯齿的解决办法
- 视图旋转之CGAffineTransformRotate和CGAffineTransformMakeRotation的区别