U3D Transform组件

Variables 
position                    Vector3类型,物体位置,相对于世界坐标系的值。就是矩阵的最后一行的值。 
localPosition             Vector3类型,物体相对于父元素的位置. 
eulerAngles              Vector3类型,旋转后的欧拉角相对世界坐标的值。简单理解为各向量坐标所转动的值就好了。 
localEulerAngles      Vector3类型,相对父元素的欧拉角。 
right                        Vector3类型,表示x轴(U3里红色的轴)方向的单位向量。 
up                           Vector3类型,表示y轴(U3里绿色的轴)方向的单位向量。 
forward                   Vector3类型,表示z轴(U3里蓝色的轴)方向的单位向量。 
rotation                   Quaternion类型(quatermion就是个四维数,比vector3多一个w变量表示旋转角度的),世界坐标旋转。. 
localRotation           Quaternion类型,本地坐标的旋转度数(相对父元素)。 
localScale                Vector3类型,相对本地坐标系缩放(就是矩阵的乘法) 
parent                      Transform类型,他的父元素。 
worldToLocalMatrix  Matrix4*4类型,把一个点从世界坐标系的位置转换为本地坐标系位置。(终究得用矩阵,哈哈)只读 
localToWorldMatrix  Matrix4*4类型,把一个点从本地坐标系转换为世界坐标系。(只读) 
root                          Transform类型,返回最上层的那个Transform,就是他父亲的父亲的父亲的。。。(如果有的话) 
childCount                int型,你子元素的数量
lossyScale                Vector3类型,相对世界坐标系缩放

u3d 3d变换函数备忘:

Transform.TransformDirection 变换方向

function TransformDirection (direction :  Vector3) : Vector3

Description描述

Transforms direction from local space to world space.

从自身坐标到世界坐标变换方向。

This operation is not affected by scale or position of the transform. The returned vector has the same length as direction. 

这个操作不会受到变换的缩放和位置的影响。返回的向量与direction有同样的长度

  

原文地址:https://www.cnblogs.com/beeasy/p/5355853.html