diff --git a/src/utils/three.js b/src/utils/three.js index deb9d29..aea3c55 100644 --- a/src/utils/three.js +++ b/src/utils/three.js @@ -402,6 +402,16 @@ function buildVectorTicks({ }); } + +function insertPicture(parent, position, modelIndex, groupName) { + const ball = ballScene.children[modelIndex].clone(true); + ball.pointId = position.id; + const point = position.pointData; + ball.position.set(...point); + ball.userData = { + } +} + /* ========== Draco解压和GLTF加载器 ========== */ const dracoLoader = new DRACOLoader().setDecoderPath("/draco/"); // 设置Draco解码器路径 const gltfLoader = new GLTFLoader().setDRACOLoader(dracoLoader); // GLTF加载器关联Draco @@ -499,7 +509,10 @@ export function drawAxes(element, options = {}, ballCallBack) { t.wrapS = t.wrapT = THREE.RepeatWrapping; } ); + nicoCustomFun(sizeX, sizeZ); + const water = new Water(new THREE.BoxGeometry(sizeX, water_height, sizeZ), { + // 纹理大小(影响波纹细节) textureWidth: 2048, // 可以增加到2048获取更高细节 textureHeight: 2048, @@ -525,9 +538,24 @@ export function drawAxes(element, options = {}, ballCallBack) { }); water.position.set(sizeX / 2, -water_height / 2, sizeZ / 2); gridGroup.add(water); + + scene.userData.waterList.push(water); } + function nicoCustomFun(sizeX, sizeZ) { + const box = new THREE.BoxGeometry(1, 1, 1); + const material = new THREE.MeshBasicMaterial({ color: "red" }); + const mesh = new THREE.Mesh(box, material); + for (let i = 0; i <= 5; i++) { + const clone = mesh.clone(true); + clone.position.set(sizeX / 5 * i, 0, 0); + const clone2 = clone.clone(true); + clone2.position.set(0, 0, sizeZ / 5 * i); + gridGroup.add(clone); + gridGroup.add(clone2); + } + } // 根据配置添加每个面上的网格线 // const color = 0xffffff, // 0x244b78 2d578a const color = 0x2d578a,