From 9961e312409d237b360a1d4877c36b88d38573fc Mon Sep 17 00:00:00 2001 From: Romain <81782365+Rom444d@users.noreply.github.com> Date: Sun, 16 Mar 2025 22:45:51 +0100 Subject: [PATCH] toit --- .../{projet.js => script.js} | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) rename ALVARIZA-BILLAR_DESERT_KANY/{projet.js => script.js} (96%) diff --git a/ALVARIZA-BILLAR_DESERT_KANY/projet.js b/ALVARIZA-BILLAR_DESERT_KANY/script.js similarity index 96% rename from ALVARIZA-BILLAR_DESERT_KANY/projet.js rename to ALVARIZA-BILLAR_DESERT_KANY/script.js index c795ece..f5a6c92 100644 --- a/ALVARIZA-BILLAR_DESERT_KANY/projet.js +++ b/ALVARIZA-BILLAR_DESERT_KANY/script.js @@ -338,18 +338,27 @@ function house() { windowCentralMesh.updateMatrix(); // creation toit pentu - const roofConeWidth = houseRoof1Width; - const roofConeHeight = houseRoof1Height; + const roofConeWidth = houseRoof1Width / 1.4; + const roofConeHeight = outerCubeHeight; + const roofConeMesh = new THREE.Mesh( + new THREE.ConeGeometry(roofConeWidth, roofConeHeight, 4), + new THREE.MeshLambertMaterial({color: 0xFF0000}) + ); + roofConeMesh.position.set( + dallePosition.x, + dallePosition.y + (dalleHeight * 2) + outerCubeHeight + (houseRoof1Height * 2) + (houseRoof2Height * 2) - 100 , // Posé sur le 1er toit + dallePosition.z + ); // Opération entre les différents éléments let baseHesh = CSG.subtract(outerCubeMesh, innerCubeMesh); - const roofHesh1 = CSG.subtract(houseRoof1, innerCubeMesh); - const roofHesh2 = CSG.subtract(houseRoof2, innerCubeMesh); baseHesh = CSG.subtract(baseHesh, doorMesh); baseHesh = CSG.subtract(baseHesh, windowLeftMesh); baseHesh = CSG.subtract(baseHesh, windowRightMesh); baseHesh = CSG.subtract(baseHesh, windowCentralMesh); + const roofHesh1 = CSG.subtract(houseRoof1, innerCubeMesh); + const roofHesh2 = CSG.subtract(houseRoof2, innerCubeMesh); baseHesh.position.set( @@ -375,11 +384,18 @@ function house() { baseHesh.rotation.y = 0.2225; roofHesh1.rotation.y = 0.2225; roofHesh2.rotation.y = 0.2225; + roofConeMesh.rotation.y = 1.015; + // Ajouter uniquement l'objet final à la scène scene.add(baseHesh); scene.add(roofHesh1); scene.add(roofHesh2); + scene.add(roofConeMesh) + + + // Creation de la lumiere à 360° au centre du toit pyramidal + const pyramidLight = new THREE.PointLight(0xFFCC06, 1, 1000); } @@ -509,6 +525,8 @@ function init() { var gui = new dat.GUI(); gui.add(window, 'carSpeed', 10, 200).step(5).name('Vitesse f1'); gui.add(window, 'carMoving').name('F1 mouvement'); + + } function animate() { -- GitLab