From c0287334b60665705eb69a11d763bd4eaf17affe Mon Sep 17 00:00:00 2001 From: Peter Hajas Date: Sat, 7 May 2022 15:24:03 -0600 Subject: [PATCH] add depth to rooms --- data.json | 3 +++ script.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/data.json b/data.json index d2e8810..c600a7c 100644 --- a/data.json +++ b/data.json @@ -6,6 +6,7 @@ "y" : 0, "w" : 5.385, "h" : 4.37, + "d" : 6.096, "color" : "yellow" }, { @@ -14,6 +15,7 @@ "y" : 4.6736, "w" : 4.9774, "h" : 3.7338, + "d" : 3.048, "color" : "red" }, { @@ -22,6 +24,7 @@ "y" : 0.6096, "w" : 4.9774, "h" : 4.6736, + "d" : 3.048, "color" : "green" } ] diff --git a/script.js b/script.js index 316cb7c..f0a9411 100644 --- a/script.js +++ b/script.js @@ -30,7 +30,7 @@ animate(); function configureScene(data) { // Add geometry for the rooms for (var room of data.rooms) { - let roomGeo = new THREE.BoxGeometry(room.w, room.h, 2) + let roomGeo = new THREE.BoxGeometry(room.w, room.h, room.d) let roomColor = new THREE.Color(room.color) let roomMaterial = new THREE.MeshPhysicalMaterial({ color: roomColor }) let roomMesh = new THREE.Mesh(roomGeo, roomMaterial)