合并注释
This commit is contained in:
10
index.html
10
index.html
@@ -21,17 +21,17 @@
|
|||||||
renderer.setSize(window.innerWidth, window.innerHeight);
|
renderer.setSize(window.innerWidth, window.innerHeight);
|
||||||
document.body.appendChild(renderer.domElement);
|
document.body.appendChild(renderer.domElement);
|
||||||
|
|
||||||
// 2. 添加立方体
|
// 2. 添加立方体(立方体:红色,中等粗糙度,高金属感)
|
||||||
const cube = new THREE.Mesh(
|
const cube = new THREE.Mesh(
|
||||||
new THREE.BoxGeometry(1, 1, 1),
|
new THREE.BoxGeometry(1, 1, 1),
|
||||||
new THREE.MeshStandardMaterial({ color: 0xff0000, roughness: 0.5, metalness: 0.8 }) // 红色,中等粗糙度,高金属感
|
new THREE.MeshStandardMaterial({ color: 0xff0000, roughness: 0.5, metalness: 0.8 })
|
||||||
);
|
);
|
||||||
scene.add(cube);
|
scene.add(cube);
|
||||||
|
|
||||||
// 添加地面
|
// 添加地面(平面:红色,中等粗糙度,高金属感)
|
||||||
const plane = new THREE.Mesh(
|
const plane = new THREE.Mesh(
|
||||||
new THREE.PlaneGeometry(10, 10), // 地面大小
|
new THREE.PlaneGeometry(10, 10),
|
||||||
new THREE.MeshStandardMaterial({ color: 0x808080, roughness: 0.5, metalness: 0.8 }) // 红色,中等粗糙度,高金属感
|
new THREE.MeshStandardMaterial({ color: 0x808080, roughness: 0.5, metalness: 0.8 })
|
||||||
);
|
);
|
||||||
plane.rotation.x = -Math.PI / 2; // 旋转地面,使其水平
|
plane.rotation.x = -Math.PI / 2; // 旋转地面,使其水平
|
||||||
plane.position.y = -1; // 将地面放置在立方体下方
|
plane.position.y = -1; // 将地面放置在立方体下方
|
||||||
|
Reference in New Issue
Block a user