我正在尝试为THREE.plane配置localClipping的位置,我发现它有点不直观。我曾经想过,是否有可能创建一些planeGeometry,操作它,并将其位置和方向转换为创建一个THREE.plane来代替它?
这将有助于配置裁剪平面的位置。
发布于 2018-09-01 02:34:29
您希望从具有THREE.Plane的Mesh中设置PlaneGeometry,并且要考虑网格的position和quaternion (或rotation)。换句话说,您希望THREE.Plane与平面Mesh对齐。
最简单的方法是使用plane.setFromNormalAndCoplanarPoint()。
法向是旋转后对平面网格的法向。共面点是平面网格中的任意点,position就行了。
var plane = new THREE.Plane();
var normal = new THREE.Vector3();
var point = new THREE.Vector3();
normal.set( 0, 0, 1 ).applyQuaternion( planeMesh.quaternion );
point.copy( planeMesh.position );
plane.setFromNormalAndCoplanarPoint( normal, point );three.js r.96号
https://stackoverflow.com/questions/52124088
复制相似问题