我需要在场景中创建三个平面几何体(一个垂直于x轴,一个垂直于y轴,一个垂直于z轴),看起来有点像这样。
下面是我创建的代码:
public showPlaneGeometry() {
console.log(this.hScene)
const geometryx = new th.PlaneGeometry(1, 1);
const geometryy = new th.PlaneGeometry(1, 1);
const geometryz = new th.PlaneGeometry(1, 1);
const material = new th.MeshBasicMaterial({
color: 0xa6cfe2,
side: th.DoubleSide,
transparent: true,
opacity: 0.5,
depthWrite: false,
});
const planex = new th.Mesh(geometryx, material);
const planey = new th.Mesh(geometryy, material);
const planez = new th.Mesh(geometryz, material);
planex.position.set(1, 0, 0);
planey.position.set(0, 1, 0)
planez.position.set(0, 0, 1)
material.transparent = true
this.hScene.add(planex, planey, planez);
}
同样的输出结果看起来令人失望: 我想知道如何让它看起来像我上面发布的图片?他们是如何在中心相交的,添加到场景中的表面网格会出现在中心交点处?非常感谢您提前的帮助。