這些是我從別的博客上看到的,覺得很有用,就轉到我自己的博客中來了,方便以后自己看,在文章最后,就是原博客地址。
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
