复杂模型计算时间过长

This commit is contained in:
Last
2025-05-08 03:03:44 +08:00
parent 999168037a
commit a954ab01c4
3 changed files with 28 additions and 10 deletions

View File

@@ -37,15 +37,33 @@
//);
//scene.add(螺丝帽模型);
// 添加育苗盘
const 育苗盘模型 = new THREE.Mesh(
new 方形育苗盘(),
new THREE.MeshStandardMaterial({ color: 0x0000ff, roughness: 0.5, metalness: 0.8 })
);
// 旋转育苗盘
育苗盘模型.rotation.x += 1.57;
育苗盘模型.rotation.y += 0;
scene.add(育苗盘模型);
setTimeout(() => {
// 添加育苗盘
console.log('添加育苗盘');
const 育苗盘模型 = new THREE.Mesh(
new 方形育苗盘(),
new THREE.MeshStandardMaterial({ color: 0x0000ff, roughness: 0.5, metalness: 0.8 })
);
// 旋转育苗盘
console.log('旋转育苗盘');
育苗盘模型.rotation.x += 1.57;
育苗盘模型.rotation.y += 0;
scene.add(育苗盘模型);
}, 1000);
//new Promise((resolve) => {
// // 添加育苗盘
// const 育苗盘模型 = new THREE.Mesh(
// new 方形育苗盘(),
// new THREE.MeshStandardMaterial({ color: 0x0000ff, roughness: 0.5, metalness: 0.8 })
// );
// // 旋转育苗盘
// 育苗盘模型.rotation.x += 1.57;
// 育苗盘模型.rotation.y += 0;
// scene.add(育苗盘模型);
// resolve();
//});
// 添加光源
scene.add(new THREE.AmbientLight(0x404040, 1)); // 环境光,柔和的白光