Treat top left coords as center coords

This commit is contained in:
nikolark committed 2014-05-26 09:52:09 +02:00
1 parent 99fbe45b00
commit 523c026f62
4 files changed
+9 -4

No files matched your search

+1 -1
View File
@@ -1 +1 @@
body,html{width:100%;height:100%;padding:0;margin:0;overflow:hidden;}canvas{width:100%;height:100%;}.debug #svg{position:absolute;top:0;bottom:0;left:0;right:0;width:100%;height:100%;}
body,html{width:100%;height:100%;padding:0;margin:0;overflow:hidden;background-color:black;}canvas{width:100%;height:100%;}#svg{display:none;}.debug #svg{display:block;position:absolute;top:0;bottom:0;left:0;right:0;width:100%;height:100%;}
+1 -1
View File
@@ -7,7 +7,7 @@
<link rel="stylesheet" href="css/app.css" type="text/css">
</head>
<body class="debug">
<body class="">
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="node_modules/three/three.js"></script>
<script src="index.js"></script>
+2 -2
View File
@@ -46,8 +46,8 @@ function onRoomData(data) {
cube = new THREE.Mesh( geometry, material );
}
cube.position.x = room.position.x;
cube.position.y = room.position.y * -1; // FIXME why flipped?
cube.position.x = room.position.x + room.dimensions.width / 2;
cube.position.y = room.position.y * -1 - room.dimensions.height / 2; // FIXME why flipped?
cube.name = room.number;
cubes.push(cube);
+5
View File
@@ -6,12 +6,17 @@ html
padding: 0;
margin: 0;
overflow: hidden;
background-color: black;
}
canvas {
width: 100%;
height: 100%;
}
#svg {
display: none;
}
.debug #svg{
display: block;
position: absolute;
top: 0;
bottom: 0;