From 13da1d8e1637e8172f77a7591a7f2f82a1dd9326 Mon Sep 17 00:00:00 2001 From: Kubbo <390378816@qq.com> Date: Wed, 10 Jul 2024 02:04:54 +0800 Subject: [PATCH] =?UTF-8?q?threejs=E5=8D=87=E7=BA=A7=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/AppThreeMap.vue | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/views/AppThreeMap.vue b/src/views/AppThreeMap.vue index 46c0126..002d136 100644 --- a/src/views/AppThreeMap.vue +++ b/src/views/AppThreeMap.vue @@ -183,6 +183,7 @@ export default { const mesh = new THREE.Mesh(areaGeometry, blockMaterial); that.mapGroup.add(mesh) that.mapGroup.scale.set(scale, scale, scale) + that.mapGroup.position.set(-3, 0, 0) that.scene.add(that.mapGroup); } @@ -399,19 +400,19 @@ export default { bevelOffset: 0, bevelSegments: 5 }); - textGeometry.translate(1, 2, -3.2) - textGeometry.rotateX(Math.PI / 3) + textGeometry.translate(1, 0, 3.2) + textGeometry.rotateX(Math.PI / 2) textGeometry.rotateZ(Math.PI / 2) textGeometry.computeTangents() const textMaterial = new THREE.MeshPhongMaterial({color: '#fff'}); const text = new THREE.Mesh(textGeometry, textMaterial); this.scene.add(text); - const planeGeometry = new THREE.PlaneGeometry(textGeometry.boundingBox.max.x, textGeometry.boundingBox.max.y); - const planeMaterial = new THREE.MeshBasicMaterial({color: '#07193D', side: THREE.DoubleSide}); - const plane = new THREE.Mesh(planeGeometry, planeMaterial); - plane.position.copy(text.position).add(new THREE.Vector3(0, -textGeometry.boundingBox.max.y, 0)); - plane.position.set(0, 0, 0); - this.scene.add(plane); + // const planeGeometry = new THREE.PlaneGeometry(textGeometry.boundingBox.max.x, textGeometry.boundingBox.max.y); + // const planeMaterial = new THREE.MeshBasicMaterial({color: '#07193D', side: THREE.DoubleSide}); + // const plane = new THREE.Mesh(planeGeometry, planeMaterial); + // plane.position.copy(text.position).add(new THREE.Vector3(0, -textGeometry.boundingBox.max.y, 0)); + // plane.position.set(0, 0, 0); + // this.scene.add(plane); }) // const div = document.createElement("div"); // div.style.color = "#fff";