unity3d如何算出一个点到一个平面的垂直距离
来源:互联网 发布:彩印编织袋价格算法 编辑:程序博客网 时间:2024/05/16 15:07
using UnityEngine;
using System.Collections;
public class NewBehaviourScript :MonoBehaviour
{
public Transform planeTarget;
public Transform target;
void Update ()
{
if (!planeTarget) {
Debug.LogWarning ("planeTarget is null");
return;
}
if (!target) {
Debug.LogWarning ("target is null");
return;
}
//Plane 类提供了处理平面所用到的基本算法
//3的点构成一个面,或者坐标和法线构成一个面
//这里使用planeTarget 坐标和法线,平面的法线也就是正面方向(up方向)
Plane plane = new Plane (planeTarget.up,planeTarget.position);
float distance = plane.GetDistanceToPoint (target.position);
Debug.Log ("distance:" + distance);
}
}
using System.Collections;
public class NewBehaviourScript :MonoBehaviour
{
public Transform planeTarget;
public Transform target;
void Update ()
{
if (!planeTarget) {
Debug.LogWarning ("planeTarget is null");
return;
}
if (!target) {
Debug.LogWarning ("target is null");
return;
}
//Plane 类提供了处理平面所用到的基本算法
//3的点构成一个面,或者坐标和法线构成一个面
//这里使用planeTarget 坐标和法线,平面的法线也就是正面方向(up方向)
Plane plane = new Plane (planeTarget.up,planeTarget.position);
float distance = plane.GetDistanceToPoint (target.position);
Debug.Log ("distance:" + distance);
}
}
0 0
- unity3d如何算出一个点到一个平面的垂直距离
- 点到平面的距离
- 点到平面的距离
- 点到平面的距离
- 点到平面的距离
- 点到平面的距离
- 点到平面的距离公式
- 点到平面的距离公式推导
- 点到平面的距离公式推导
- 点到平面的距离公式
- 《点到平面的距离公式》推导
- 点到平面的距离计算
- 点到平面的距离公式
- [Google] 平面上有很多点( x,y均为整数) ,求一个点 ,使该点到 所有点的 曼哈顿距离和 最小
- 如何从网页代码中看出一个元素到浏览器顶端的距离?
- 点到线段的垂直距离
- 平面中用到的公式(点到平面的距离、平面上的最近点)
- 项目1——距离是一个点到另外一个点的距离
- 登录界面 Android简单http get请求(含服务器端)二
- time_wait
- Linux内核源码分析_setup_arch函数的主要作用
- android 调用webservice时出错org.xmlpull.v1.XmlPullParserException的解决办法
- 自定义drawable文件夹下的button和图片选择
- unity3d如何算出一个点到一个平面的垂直距离
- ASP.NET连接数据库操作
- java基础之:集合
- 43、MySQL-删除视图
- ios自动布局
- (转)iOS 8 AutoLayout与Size Class自悟
- oracle11g锁定密码及默认密码有效期180天
- JVM 常量池理解
- oscache缓存使用总结