在three.js中找到一束平面(3)的交点

问题描述 投票:0回答:2

我正在尝试使用此Wolfram页面底部的公式来实现3平面相交:http://mathworld.wolfram.com/Plane-PlaneIntersection.html

If the three planes are each specified by a point xk and a unit normal vector     
nk, then the unique point of intersection  x is given by

x = (|n1 n2 n3|)^(-1) [(x1 · n1)(n2 x n3)+(x2 · n2)(n3 x n1)+(x3 · n3)(n3 x n2)],   

where |n1 n2 n3| is the determinant of the matrix formed by writing the 
vectors ni side-by-side. If two of the planes are parallel, then

|n1 n2 n3| = 0, 

但是据我所知,我的矩阵数学太糟糕了,对Three.js矩阵我不太满意

var x1, x2, x3; // all clones
var n1, n2, n3; // all clones, normalized

var f1 = (x1.dot(n1)).something(n2.cross(n3));
var f2 = (x2.dot(n2)).something(n3.cross(n1));
var f3 = (x3.dot(n3)).something(n1.cross(n2));

var full = f1.add(f2).add(f3);

首先,'(x1·n1)(n2 x n3)'是什么意思?我知道第一个是点积,而部分是叉积,我该怎么做才能将它们结合起来

第二,如何在Three.js中编写矩阵部分

math 3d three.js geometry
2个回答
1
投票

第一:


0
投票

这里有一个现成的功能:参数:平面p1,p2,p3返回:Vector3

© www.soinside.com 2019 - 2024. All rights reserved.