Browse Source

add depth to rooms

master
Peter Hajas 3 years ago
parent
commit
c0287334b6
  1. 3
      data.json
  2. 2
      script.js

3
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"
}
]

2
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)

Loading…
Cancel
Save