矩形旋转一定角度后,四个点的新坐标

这些是我从别的博客上看到的,觉得很有用,就转到我自己的博客中来了,方便以后自己看,在文章最后,就是原博客地址。

1:已知3D坐标和一个旋转角度,及一段距离,求目标点的3D坐标

  已知当前点为target,目标点沿着target的Y轴旋转30度,沿着target的X轴延伸10米,求目标点新的3D坐标

using UnityEngine;
using System.Collections;
 
public class Test:MonoBehaviour
{
     //目标
 public Transform target;
   
 void LateUpdate(){
                Quaternion rotation=Quaternion.Euler(0f,30f,0f)*target.rotation;
                    Vector3 newPos=rotation*new Vector3(10f,0f,0f);
	}      
}

  

 

 

 

http://www.cnblogs.com/He-Jing/p/3783061.html

posted on 2016-12-12 13:56  jiahuafu  阅读(4697)  评论(0编辑  收藏  举报

导航