저는 three.js에서 새로 왔으며 ShapeGeometry를 업데이트하려고했지만 작동하지 않았습니다. 이제는 형상 메쉬를 제거하고 읽어야합니다. Shape가 생성 된 기하학 단지 높은 수준의 설명이기 때문에, 당신이 ShapeGeometry에 의해 사용되는 모양을 업데이트 할 수 없습니다,three.js에서 ShapeGeometry를 업데이트하는 방법
this.mesh.geometry.dispose()
this.mesh.material.dispose()
this.scene.remove(this.mesh)
//vertex
this.triangleShape = new THREE.Shape()
this.triangleShape.moveTo( -612+this.Eposition.left, 310-this.Eposition.top-25)
for(let i = 0 ; i < length ; i++) {
this.triangleShape.lineTo(data[i][0],data[i][1])
}
this.triangleShape.lineTo( -612+this.Eposition.left+141, 310-this.Eposition.top-25)
this.triangleShape.lineTo( -612+this.Eposition.left+141, 310-this.Eposition.top)
this.triangleShape.lineTo( -612+this.Eposition.left, 310-this.Eposition.top)
this.triangleShape.lineTo( -612+this.Eposition.left, 310-this.Eposition.top-25)// close path
let geometry = new THREE.ShapeGeometry(this.triangleShape)
this.mesh = new THREE.Mesh(geometry,this.material)
this.scene.add(this.mesh)
필자는 this.mesh.geometry.verticesNeedUpdate = true
를 작성했는데, 그것은