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)