From 853ddfba3f7a105e3a82ff2e470a24b380b1cbe5 Mon Sep 17 00:00:00 2001 From: Hcat <2768237203@qq.com> Date: Sun, 21 Jan 2024 21:10:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BB=96=E6=9D=B0=EF=BC=9A=E8=B7=AF=E7=89=8C?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sceneClass/utils/StreetSignTag.JS | 26 ------------------- 1 file changed, 26 deletions(-) delete mode 100644 src/components/content/tunnelScene/sceneClass/utils/StreetSignTag.JS diff --git a/src/components/content/tunnelScene/sceneClass/utils/StreetSignTag.JS b/src/components/content/tunnelScene/sceneClass/utils/StreetSignTag.JS deleted file mode 100644 index 0e736cb..0000000 --- a/src/components/content/tunnelScene/sceneClass/utils/StreetSignTag.JS +++ /dev/null @@ -1,26 +0,0 @@ -import * as THREE from "three";/** -* 返回一个带有文字的的#3D材质 -* 把输入的文字转化为base64的img图片 -* @param {String} text -* @param {String} param 传感器实时检测参数 -*/ -export default function (text = "", param = "", width = 250, height = 150) { - const canvas = document.createElement("canvas"); - canvas.width = width; - canvas.height = height; - const ctx = canvas.getContext("2d"); - ctx.fillStyle = "#003BA8"; - ctx.fillRect(0, 0, width, height); - ctx.fillStyle = "white"; - ctx.font = "15px serif"; - ctx.fillText('隧道简称:' + text, (100 - text.length * 1) / 50, 40); - ctx.fillText('隧道长度:' + param + 'm', (100 - param.length * 1) / 50, 115); - ctx.strokeStyle = "white"; - ctx.moveTo(0, 75); - ctx.lineTo(30000, 120); - ctx.stroke(); - const base64 = canvas.toDataURL(); - return new THREE.MeshBasicMaterial({ - map: new THREE.TextureLoader().load(base64), - }); -} \ No newline at end of file