码迷,mamicode.com
首页 > 其他好文 > 详细

U3D向量投影

时间:2015-04-30 15:49:16      阅读:198      评论:0      收藏:0      [点我收藏+]

标签:

技术分享

官方例图

 

测试:

 技术分享

 

code:

public Transform point1;
public Transform point2;
public Transform humanPoint;
public Transform targetPoint;

void Start()
{
}

void Update()
{
    targetPoint.position = point1.position + Vector3.Project(humanPoint.position - point1.position, point2.position - point1.position);
}

 

官方论坛扩展阅读LINK

U3D向量投影

标签:

原文地址:http://www.cnblogs.com/hont/p/4468789.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!