【问题标题】:Three.js Plane and line intersectLine三.js 平面与直线 intersectLine
【发布时间】:2014-10-03 12:02:07
【问题描述】:

我对@9​​87654321@ 在 three.js

中的工作方式有疑问

我有一条线(line)和一个平面(planoref),我想知道交点。

new THREE.Vector3( planoref.intersectLine(line));

但回复是:planoref.intersectLine is not a function"

这个功能是如何工作的? 如何知道直线或射线与平面的交点?

谢谢

【问题讨论】:

    标签: three.js line intersect plane


    【解决方案1】:

    您的代码可能包含错误,或者您使用的可能是过期版本的 three.js。以下代码片段工作并输出预期的“5”。

    var line = new THREE.Line3(new THREE.Vector3(0,10,0), new THREE.Vector3(0,-10,0));
    var planoref = new THREE.Plane(new THREE.Vector3(0,1,0), -5);
    alert( planoref.intersectLine(line).y);
    

    【讨论】:

      猜你喜欢
      • 2013-03-22
      • 1970-01-01
      • 1970-01-01
      • 2017-03-14
      • 1970-01-01
      • 2015-03-06
      • 1970-01-01
      • 2014-05-27
      • 1970-01-01
      相关资源
      最近更新 更多