Skip to content
Snippets Groups Projects
Commit 08ac786a authored by VoidOma's avatar VoidOma
Browse files

modif ombre

parent 875d3a0c
Branches
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment