首页 > 其他 > 详细

Transform.TransformDirection 变换方向

时间:2017-01-14 19:05:17      阅读:302      评论:0      收藏:0      [点我收藏+]

官方描述:

JavaScript ? TransformDirection(direction: Vector3): Vector3; 
C# ? Vector3 TransformDirection(Vector3 direction);

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有同样的长度。

 

个人理解:
如自身Z轴方向跟世界Z轴方向一致,目前我的位置是(0,0,0),我向前(相对自身)移动一个单位,我的位置变成(0,0,1),
即为:transform.postion += vector3(0,0,1);
当自身Z轴方向跟世界X轴方向一致时,我的位置还是(0,0,0),我向前(相对自身)移动一个单位,我的位置变成(1,0,0),
即为:transform.postion += transform.TransformDirection(vector3(0,0,1))的结果。
    
 

Transform.TransformDirection 变换方向

原文:http://www.cnblogs.com/living481/p/6285869.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!