This commit is contained in:
Last
2025-05-06 22:59:15 +08:00
parent 54d825ce59
commit 999168037a
2 changed files with 25 additions and 23 deletions

View File

@@ -30,19 +30,21 @@
//);
//scene.add(cube);
// 添加螺丝帽
const 螺丝帽模型 = new THREE.Mesh(
new 六角螺丝帽(1, 0.5, 0.6),
new THREE.MeshStandardMaterial({ color: 0x00ff00, roughness: 0.5, metalness: 0.8 })
);
scene.add(螺丝帽模型);
//// 添加螺丝帽
//const 螺丝帽模型 = new THREE.Mesh(
// new 六角螺丝帽(1, 0.5, 0.6),
// new THREE.MeshStandardMaterial({ color: 0x00ff00, roughness: 0.5, metalness: 0.8 })
//);
//scene.add(螺丝帽模型);
// 添加育苗盘
const 育苗盘模型 = new THREE.Mesh(
new 方形育苗盘(),
new THREE.MeshStandardMaterial({ color: 0x0000ff, roughness: 0.5, metalness: 0.8 })
);
//育苗盘模型.position.set(0, -1, 0); // 设置育苗盘位置
// 旋转育苗盘
育苗盘模型.rotation.x += 1.57;
育苗盘模型.rotation.y += 0;
scene.add(育苗盘模型);
// 添加光源
@@ -51,7 +53,7 @@
directionalLight.position.set(5, 5, 5); // 设置光源位置
scene.add(directionalLight);
camera.position.z = 5;
camera.position.z = .75;
// 3. 动画循环
function animate() {
@@ -59,13 +61,13 @@
//cube.rotation.x += 0.01;
//cube.rotation.y += 0.01;
// 旋转育苗盘
育苗盘模型.rotation.x += 0.01;
育苗盘模型.rotation.y += 0.01;
//// 旋转育苗盘
//育苗盘模型.rotation.x += 0.01;
//育苗盘模型.rotation.y += 0.01;
// 旋转螺丝帽
螺丝帽模型.rotation.x += 0.01;
螺丝帽模型.rotation.y += 0.01;
//// 旋转螺丝帽
//螺丝帽模型.rotation.x += 0.01;
//螺丝帽模型.rotation.y += 0.01;
renderer.render(scene, camera);
}