当初弄不明白旋转..居然找不到资料四元数应该用轴角相乘...后来自己摸明白了 通过两种旋转的配合,可以告别世界空间和本地空间矩阵转换了,大大提升效率. 每个轴相乘即可,可以任意轴,无限乘.无万向节锁问题 四元数旋转: 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
1 Unity原生 1.1 GUI void OnGUI(){ if(GUI.Button(Rect position, string text)){ //点击后立即执行 } 1.1 Input 每个手指触控是通过Input.touches数据结构描述的: fingerId 手指索引 The unique index for a touch. 触摸的唯一索引. position 位置 The screen position of the touch. 触摸屏幕的位置. deltaPosition
2 Vuforia in Unity Tutorial: https://www.youtube.com/watch?v=X6djed8e4n0&t=213s Preparation: Download "Vuforia for Unity" from https://developer.vuforia.com/downloads/sdk?d=windows-30-16-4815&retU import Vuforia into Unity by dragging &q