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 c795ece37cbd557c66b5276836193799c78af303..f5a6c9203c68d08a3ba5edfd17adb77999b6d4c9 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() {