Use min_height in building models for bridges and things

0.2
Brian Chirls 2014-12-03 11:37:32 -05:00
rodzic 7a997a2f85
commit c8698ace12
2 zmienionych plików z 8 dodań i 4 usunięć

Wyświetl plik

@ -1,6 +1,6 @@
var world = new VIZI.World({
viewport: document.querySelector("#vizicities-viewport")
// center: new VIZI.LatLon(40.01000594412381, -105.2727379358738) // Collada
viewport: document.querySelector("#vizicities-viewport"),
center: new VIZI.LatLon(40.742766592577496, -74.00731522962627) // Collada
});
var controls = new VIZI.ControlsMap(world.camera);
@ -135,7 +135,8 @@ var buildingsConfig = {
itemsProperties: "features",
transformation: {
outline: "geometry.coordinates",
height: "properties.height"
height: "properties.height",
min_height: "properties.min_height"
}
},
tile: "tile"

Wyświetl plik

@ -353,14 +353,17 @@
// TODO: Don't have random height logic in here
var height = (feature.height) ? feature.height : 5 + Math.random() * 10;
var minHeight = (feature.min_height) ? feature.min_height : 0;
// TODO: Add floor/level-based heights
// << rounds the height down
// var height = (feature.height * metersPerLevel * scalingFactor << 0);
// Multiply height in meters by pixels per meter ratio at latitude
height *= ppm.y;
minHeight *= ppm.y;
var extrudeSettings = { amount: height, bevelEnabled: false };
var extrudeSettings = { amount: height - minHeight, bevelEnabled: false };
var geom = new THREE.ExtrudeGeometry( shape, extrudeSettings );
geom.computeFaceNormals();