diff --git a/MATEJKA_MAURICE_COLIN/index.js b/MATEJKA_MAURICE_COLIN/index.js index c0c22b1b562c49f4989f8591a6f0c15bc9f22545..e8fdb31052a2b08823e3c1adcce6836d8c23f21e 100644 --- a/MATEJKA_MAURICE_COLIN/index.js +++ b/MATEJKA_MAURICE_COLIN/index.js @@ -46,7 +46,7 @@ function init() { new THREE.MeshLambertMaterial({ map: grassTexture }) ); solidGround.rotation.x = -Math.PI / 2; - solidGround.receiveShadow = true; // Recevoir les ombres + solidGround.receiveShadow = true; scene.add(solidGround); // Chargement du modèle LowPolyHuman @@ -57,8 +57,8 @@ function init() { object.traverse((child) => { if (child.isMesh) { child.material = new THREE.MeshStandardMaterial({ color: 0x0000FF, metalness: 0.5, roughness: 0.5 }); - child.castShadow = true; // Projeter des ombres - child.receiveShadow = true; // Recevoir des ombres + child.castShadow = true; + child.receiveShadow = true; } }); object.position.set(0.5, 0, 0); @@ -80,8 +80,8 @@ function init() { const stool = new THREE.Mesh(stoolGeometry, stoolMaterial); stool.scale.set(0.5, 0.5, 0.5); stool.position.set(1.5, 0.25, 0); - stool.castShadow = true; // Projeter des ombres - stool.receiveShadow = true; // Recevoir des ombres + stool.castShadow = true; + stool.receiveShadow = true; scene.add(stool); // Chargement du modèle Chevalet @@ -91,8 +91,8 @@ function init() { object.traverse((child) => { if (child.isMesh) { child.material = new THREE.MeshStandardMaterial({ color: 0xaaaaaa, metalness: 0.4, roughness: 0.6 }); - child.castShadow = true; // Projeter des ombres - child.receiveShadow = true; // Recevoir des ombres + child.castShadow = true; + child.receiveShadow = true; } }); object.position.set(0.5, 0.5, -1.25); @@ -119,15 +119,15 @@ function init() { } }); - // Positionner la bougie au même endroit que le tabouret, mais plus haut + // la bougie au même endroit que le tabouret, mais plus haut object.position.set(stool.position.x, stool.position.y + 0.3, stool.position.z); - object.scale.set(0.7, 0.7, 0.7); // Ajuster la taille si nécessaire + object.scale.set(0.7, 0.7, 0.7); scene.add(object); // Ajouter une lumière pour simuler la flamme de la bougie const candleLight = new THREE.PointLight(0xffa500, 1.5, 2); candleLight.position.set(object.position.x, object.position.y + 0.3, object.position.z); - candleLight.castShadow = true; // La lumière de la bougie projette des ombres + candleLight.castShadow = true; scene.add(candleLight); function animateCandleLight() { @@ -145,10 +145,6 @@ function init() { } ); - var light = new THREE.DirectionalLight(0xffffff, 1, 100); - light.position.set(10, 10, 10); - light.castShadow = true; // La lumière directionnelle projette des ombres - scene.add(light); var ambientLight = new THREE.AmbientLight(0x404040); scene.add(ambientLight);