Browse Source

better room dimensions

master
Peter Hajas 3 years ago
parent
commit
676d7b42d6
  1. 46
      data.json
  2. 4
      script.js

46
data.json

@ -1,40 +1,34 @@
{
"rooms" : [
{
"name" : "Great Room",
"x" : 4.9784,
"y" : 0,
"w" : 5.385,
"h" : 4.37,
"d" : 6.096,
"color" : "yellow"
"name" : "Patio",
"x" : 0, "y" : 0.6096,
"w" : 4.9774, "h" : 4.6736, "d" : 3.048,
"color" : "green"
},
{
"name" : "Dining Room",
"x" : 0,
"y" : 4.6736,
"w" : 4.9774,
"h" : 3.7338,
"d" : 3.048,
"x" : 0, "y" : 5.2832,
"w" : 4.9774, "h" : 3.7338, "d" : 3.048,
"color" : "red"
},
{
"name" : "Patio",
"x" : 0,
"y" : 0.6096,
"w" : 4.9774,
"h" : 4.6736,
"d" : 3.048,
"color" : "green"
},
{
"name" : "Stairway",
"x" : 0,
"y" : 7.7216,
"w" : 2.9972,
"h" : 3.149,
"d" : 6.096,
"x" : 0, "y" : 9.017,
"w" : 2.9972, "h" : 3.149, "d" : 6.096,
"color" : "blue"
},
{
"name" : "Office",
"x" : 0, "y" : 12.166,
"w" : 3.5179, "h" : 3.8608, "d" : 3.048,
"color" : "orange"
},
{
"name" : "Great Room",
"x" : 4.9784, "y" : 0,
"w" : 5.385, "h" : 4.37, "d" : 6.096,
"color" : "yellow"
}
]
}

4
script.js

@ -30,8 +30,8 @@ animate();
function setPosition(mesh, x, y, z, w, h, d) {
// position sets the *center* position
// our coordinates are top/left/bottom
let meshX = x - w/2
let meshY = y - h/2
let meshX = x + w/2
let meshY = y + h/2
let meshZ = z - d/2
mesh.position.x = meshX
mesh.position.y = meshY

Loading…
Cancel
Save