当初弄不明白旋转..居然找不到资料四元数应该用轴角相乘...后来自己摸明白了 通过两种旋转的配合,可以告别世界空间和本地空间矩阵转换了,大大提升效率. 每个轴相乘即可,可以任意轴,无限乘.无万向节锁问题 四元数旋转: using UnityEngine; using System.Collections; public class RotationTest : MonoBehaviour { public float x, y, z; void Start () { } void Update…
using UnityEngine; using System.Collections; public class Triangle : MonoBehaviour { public float speed = 90; // Update is called once per frame void Update () { transform.Rotate(Vector3.forward*Time.deltaTime*speed); } public void ChangeSpeed(float…
using UnityEngine; using System.Collections; public class SandR : MonoBehaviour { public GameObject controlled; public float scaleSpeed=0.5f; public float scaleValue = 0; public float rotateSpeed = -3; void Update() { Scale(); if (Input.GetMouseButto…