Skip to content
Snippets Groups Projects
Commit 9961e312 authored by Romain's avatar Romain
Browse files

toit

parent 79b6b218
No related branches found
No related tags found
No related merge requests found
...@@ -338,18 +338,27 @@ function house() { ...@@ -338,18 +338,27 @@ function house() {
windowCentralMesh.updateMatrix(); windowCentralMesh.updateMatrix();
// creation toit pentu // creation toit pentu
const roofConeWidth = houseRoof1Width; const roofConeWidth = houseRoof1Width / 1.4;
const roofConeHeight = houseRoof1Height; 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 // Opération entre les différents éléments
let baseHesh = CSG.subtract(outerCubeMesh, innerCubeMesh); 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, doorMesh);
baseHesh = CSG.subtract(baseHesh, windowLeftMesh); baseHesh = CSG.subtract(baseHesh, windowLeftMesh);
baseHesh = CSG.subtract(baseHesh, windowRightMesh); baseHesh = CSG.subtract(baseHesh, windowRightMesh);
baseHesh = CSG.subtract(baseHesh, windowCentralMesh); baseHesh = CSG.subtract(baseHesh, windowCentralMesh);
const roofHesh1 = CSG.subtract(houseRoof1, innerCubeMesh);
const roofHesh2 = CSG.subtract(houseRoof2, innerCubeMesh);
baseHesh.position.set( baseHesh.position.set(
...@@ -375,11 +384,18 @@ function house() { ...@@ -375,11 +384,18 @@ function house() {
baseHesh.rotation.y = 0.2225; baseHesh.rotation.y = 0.2225;
roofHesh1.rotation.y = 0.2225; roofHesh1.rotation.y = 0.2225;
roofHesh2.rotation.y = 0.2225; roofHesh2.rotation.y = 0.2225;
roofConeMesh.rotation.y = 1.015;
// Ajouter uniquement l'objet final à la scène // Ajouter uniquement l'objet final à la scène
scene.add(baseHesh); scene.add(baseHesh);
scene.add(roofHesh1); scene.add(roofHesh1);
scene.add(roofHesh2); 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() { ...@@ -509,6 +525,8 @@ function init() {
var gui = new dat.GUI(); var gui = new dat.GUI();
gui.add(window, 'carSpeed', 10, 200).step(5).name('Vitesse f1'); gui.add(window, 'carSpeed', 10, 200).step(5).name('Vitesse f1');
gui.add(window, 'carMoving').name('F1 mouvement'); gui.add(window, 'carMoving').name('F1 mouvement');
} }
function animate() { function animate() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment