From ccf308d4481e5735c2000e4f7ef6f0c9aa19d400 Mon Sep 17 00:00:00 2001 From: Sven Schneider Date: Tue, 4 May 2021 15:55:25 +0200 Subject: [PATCH] replaced OSM Bld Layer with Stoeackach 3dTile model and changed target bld color to red, removed also the other layers --- public/Kirchturm1.js | 274 ++++++++++---------- public/Kirchturm2.js | 276 ++++++++++---------- public/circData.js | 587 ++++++++++++++++++++++--------------------- public/index.html | 6 +- 4 files changed, 573 insertions(+), 570 deletions(-) diff --git a/public/Kirchturm1.js b/public/Kirchturm1.js index 2673719..da966c8 100644 --- a/public/Kirchturm1.js +++ b/public/Kirchturm1.js @@ -59,51 +59,51 @@ $(function () { canvas.focus(); var scene = viewer.scene; - var osmBuildings = viewer.scene.primitives.add( - new Cesium.Cesium3DTileset({ - url: Cesium.IonResource.fromAssetId(96188), - }) - ); + // var osmBuildings = viewer.scene.primitives.add( + // new Cesium.Cesium3DTileset({ + // url: Cesium.IonResource.fromAssetId(96188), + // }) + // ); - const buildingHeightOffset = 60; //53 + const buildingHeightOffset = 55; //53 ///////////////////// STOECKACH LOD 1 - // var stoeckach = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ - // url: 'buildingTiles/StoeckachLOD1/tileset.json', - // show: true - // })); + var stoeckach = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ + url: 'buildingTiles/StoeckachLOD1/tileset.json', + show: true + })); - // stoeckach.readyPromise.then(function (stoeckach) { + stoeckach.readyPromise.then(function (stoeckach) { - // var R = 0; // roll - // var P = 0; // pitch - // var Yaw = 0; // yaw - // var height = buildingHeightOffset; - // var cartographic = Cesium.Cartographic.fromCartesian(stoeckach.boundingSphere.center); - // var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0); - // var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, height); - // var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3()); + var R = 0; // roll + var P = 0; // pitch + var Yaw = 0; // yaw + var height = buildingHeightOffset -1 ; + var cartographic = Cesium.Cartographic.fromCartesian(stoeckach.boundingSphere.center); + var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0); + var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, height); + var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3()); - // //var rotMat = new Cesium.Matrix3(); - // var rotation = new Cesium.Matrix3.fromHeadingPitchRoll(new Cesium.HeadingPitchRoll(Yaw, P, R)); + //var rotMat = new Cesium.Matrix3(); + var rotation = new Cesium.Matrix3.fromHeadingPitchRoll(new Cesium.HeadingPitchRoll(Yaw, P, R)); - // stoeckach.modelMatrix = Cesium.Matrix4.fromRotationTranslation(rotation,translation); + stoeckach.modelMatrix = Cesium.Matrix4.fromRotationTranslation(rotation,translation); - // return zoomAll(stoeckach); - // }); + return zoomAll(stoeckach); + }); - // stoeckach.readyPromise.then(function(stoeckach){ - // stoeckach.style = new Cesium.Cesium3DTileStyle({ - // color: "color('white',0.5)", - // }) - // }); + stoeckach.readyPromise.then(function(stoeckach){ + stoeckach.style = new Cesium.Cesium3DTileStyle({ + color: "color('white',1)", + }) + }); @@ -138,7 +138,7 @@ $(function () { target_tileset.readyPromise.then(function(target_tileset){ target_tileset.style = new Cesium.Cesium3DTileStyle({ - color: "color('black',0.5)", + color: "color('red',0.9)", }) }); @@ -147,157 +147,157 @@ $(function () { ///////////////////////////// Layer one ////////////////////////// - var L1 = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ - url: 'buildingTiles/circularTiles/L1_yellow/tileset.json', - show: true, + // var L1 = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ + // url: 'buildingTiles/circularTiles/L1_yellow/tileset.json', + // show: true, - })); + // })); - L1.readyPromise.then(function (L1) { - return zoomAll(L1); - }); + // L1.readyPromise.then(function (L1) { + // return zoomAll(L1); + // }); - L1.readyPromise.then(function (L1) { + // L1.readyPromise.then(function (L1) { - var R = 0; // roll - var P = 0; // pitch - var Yaw = 0; // yaw - var height = buildingHeightOffset; - var cartographic = Cesium.Cartographic.fromCartesian(L1.boundingSphere.center); - var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0); - var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, height); - var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3()); + // var R = 0; // roll + // var P = 0; // pitch + // var Yaw = 0; // yaw + // var height = buildingHeightOffset; + // var cartographic = Cesium.Cartographic.fromCartesian(L1.boundingSphere.center); + // var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0); + // var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, height); + // var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3()); - //var rotMat = new Cesium.Matrix3(); - var rotation = new Cesium.Matrix3.fromHeadingPitchRoll(new Cesium.HeadingPitchRoll(Yaw, P, R)); + // //var rotMat = new Cesium.Matrix3(); + // var rotation = new Cesium.Matrix3.fromHeadingPitchRoll(new Cesium.HeadingPitchRoll(Yaw, P, R)); - L1.modelMatrix = Cesium.Matrix4.fromRotationTranslation(rotation,translation); + // L1.modelMatrix = Cesium.Matrix4.fromRotationTranslation(rotation,translation); - return zoomAll(L1); - }); + // return zoomAll(L1); + // }); - L1.readyPromise.then(function(L1){ - L1.style = new Cesium.Cesium3DTileStyle({ - color: "color('yellow',1)", - }) - }); + // L1.readyPromise.then(function(L1){ + // L1.style = new Cesium.Cesium3DTileStyle({ + // color: "color('yellow',1)", + // }) + // }); - ///////////////////////////// Layer 2 ////////////////////////// + // ///////////////////////////// Layer 2 ////////////////////////// - var L2 = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ - url: 'buildingTiles/circularTiles/L2_red/tileset.json', - show: true, + // var L2 = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ + // url: 'buildingTiles/circularTiles/L2_red/tileset.json', + // show: true, - })); + // })); - L2.readyPromise.then(function (L2) { - return zoomAll(L2); - }); + // L2.readyPromise.then(function (L2) { + // return zoomAll(L2); + // }); - L2.readyPromise.then(function (L2) { + // L2.readyPromise.then(function (L2) { - var R = 0; // roll - var P = 0; // pitch - var Yaw = 0; // yaw - var height = buildingHeightOffset; - var cartographic = Cesium.Cartographic.fromCartesian(L2.boundingSphere.center); - var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0); - var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, height); - var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3()); + // var R = 0; // roll + // var P = 0; // pitch + // var Yaw = 0; // yaw + // var height = buildingHeightOffset; + // var cartographic = Cesium.Cartographic.fromCartesian(L2.boundingSphere.center); + // var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0); + // var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, height); + // var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3()); - //var rotMat = new Cesium.Matrix3(); - var rotation = new Cesium.Matrix3.fromHeadingPitchRoll(new Cesium.HeadingPitchRoll(Yaw, P, R)); + // //var rotMat = new Cesium.Matrix3(); + // var rotation = new Cesium.Matrix3.fromHeadingPitchRoll(new Cesium.HeadingPitchRoll(Yaw, P, R)); - L2.modelMatrix = Cesium.Matrix4.fromRotationTranslation(rotation,translation); + // L2.modelMatrix = Cesium.Matrix4.fromRotationTranslation(rotation,translation); - return zoomAll(L2); - }); + // return zoomAll(L2); + // }); - L2.readyPromise.then(function(L2){ - L2.style = new Cesium.Cesium3DTileStyle({ - color: "color('red',1)", - }) - }); + // L2.readyPromise.then(function(L2){ + // L2.style = new Cesium.Cesium3DTileStyle({ + // color: "color('red',1)", + // }) + // }); - ///////////////////////////// Layer 3 ////////////////////////// + // ///////////////////////////// Layer 3 ////////////////////////// - var L3 = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ - url: 'buildingTiles/circularTiles/L3_green/tileset.json', - show: true, + // var L3 = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ + // url: 'buildingTiles/circularTiles/L3_green/tileset.json', + // show: true, - })); + // })); - L3.readyPromise.then(function (L3) { - return zoomAll(L3); - }); + // L3.readyPromise.then(function (L3) { + // return zoomAll(L3); + // }); - L3.readyPromise.then(function (L3) { + // L3.readyPromise.then(function (L3) { - var R = 0; // roll - var P = 0; // pitch - var Yaw = 0; // yaw - var height = buildingHeightOffset; - var cartographic = Cesium.Cartographic.fromCartesian(L3.boundingSphere.center); - var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0); - var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, height); - var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3()); + // var R = 0; // roll + // var P = 0; // pitch + // var Yaw = 0; // yaw + // var height = buildingHeightOffset; + // var cartographic = Cesium.Cartographic.fromCartesian(L3.boundingSphere.center); + // var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0); + // var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, height); + // var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3()); - //var rotMat = new Cesium.Matrix3(); - var rotation = new Cesium.Matrix3.fromHeadingPitchRoll(new Cesium.HeadingPitchRoll(Yaw, P, R)); + // //var rotMat = new Cesium.Matrix3(); + // var rotation = new Cesium.Matrix3.fromHeadingPitchRoll(new Cesium.HeadingPitchRoll(Yaw, P, R)); - L3.modelMatrix = Cesium.Matrix4.fromRotationTranslation(rotation,translation); + // L3.modelMatrix = Cesium.Matrix4.fromRotationTranslation(rotation,translation); - return zoomAll(L3); - }); + // return zoomAll(L3); + // }); - L3.readyPromise.then(function(L3){ - L3.style = new Cesium.Cesium3DTileStyle({ - color: "color('green',1)", - }) - }); + // L3.readyPromise.then(function(L3){ + // L3.style = new Cesium.Cesium3DTileStyle({ + // color: "color('green',1)", + // }) + // }); - ///////////////////////////// Layer 3 ////////////////////////// + // ///////////////////////////// Layer 3 ////////////////////////// - var L4 = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ - url: 'buildingTiles/circularTiles/L4_brown/tileset.json', - show: true, + // var L4 = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ + // url: 'buildingTiles/circularTiles/L4_brown/tileset.json', + // show: true, - })); + // })); - L4.readyPromise.then(function (L4) { - return zoomAll(L4); - }); + // L4.readyPromise.then(function (L4) { + // return zoomAll(L4); + // }); - L4.readyPromise.then(function (L4) { + // L4.readyPromise.then(function (L4) { - var R = 0; // roll - var P = 0; // pitch - var Yaw = 0; // yaw - var height = buildingHeightOffset; - var cartographic = Cesium.Cartographic.fromCartesian(L4.boundingSphere.center); - var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0); - var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, height); - var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3()); + // var R = 0; // roll + // var P = 0; // pitch + // var Yaw = 0; // yaw + // var height = buildingHeightOffset; + // var cartographic = Cesium.Cartographic.fromCartesian(L4.boundingSphere.center); + // var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0); + // var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, height); + // var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3()); - //var rotMat = new Cesium.Matrix3(); - var rotation = new Cesium.Matrix3.fromHeadingPitchRoll(new Cesium.HeadingPitchRoll(Yaw, P, R)); + // //var rotMat = new Cesium.Matrix3(); + // var rotation = new Cesium.Matrix3.fromHeadingPitchRoll(new Cesium.HeadingPitchRoll(Yaw, P, R)); - L4.modelMatrix = Cesium.Matrix4.fromRotationTranslation(rotation,translation); + // L4.modelMatrix = Cesium.Matrix4.fromRotationTranslation(rotation,translation); - return zoomAll(L4); - }); + // return zoomAll(L4); + // }); - L4.readyPromise.then(function(L4){ - L4.style = new Cesium.Cesium3DTileStyle({ - color: "color('CORAL',1)", - }) - }); + // L4.readyPromise.then(function(L4){ + // L4.style = new Cesium.Cesium3DTileStyle({ + // color: "color('CORAL',1)", + // }) + // }); var camera = viewer.camera; diff --git a/public/Kirchturm2.js b/public/Kirchturm2.js index 3bfcb4c..423bb67 100644 --- a/public/Kirchturm2.js +++ b/public/Kirchturm2.js @@ -59,51 +59,51 @@ $(function () { canvas.focus(); var scene = viewer.scene; - var osmBuildings = viewer.scene.primitives.add( - new Cesium.Cesium3DTileset({ - url: Cesium.IonResource.fromAssetId(96188), - }) - ); + // var osmBuildings = viewer.scene.primitives.add( + // new Cesium.Cesium3DTileset({ + // url: Cesium.IonResource.fromAssetId(96188), + // }) + // ); - const buildingHeightOffset = 60; //53 + const buildingHeightOffset = 55; //53 ///////////////////// STOECKACH LOD 1 - // var stoeckach = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ - // url: 'buildingTiles/StoeckachLOD1/tileset.json', - // show: true - // })); + var stoeckach = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ + url: 'buildingTiles/StoeckachLOD1/tileset.json', + show: true + })); - // stoeckach.readyPromise.then(function (stoeckach) { + stoeckach.readyPromise.then(function (stoeckach) { - // var R = 0; // roll - // var P = 0; // pitch - // var Yaw = 0; // yaw - // var height = buildingHeightOffset; - // var cartographic = Cesium.Cartographic.fromCartesian(stoeckach.boundingSphere.center); - // var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0); - // var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, height); - // var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3()); + var R = 0; // roll + var P = 0; // pitch + var Yaw = 0; // yaw + var height = buildingHeightOffset - 1; + var cartographic = Cesium.Cartographic.fromCartesian(stoeckach.boundingSphere.center); + var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0); + var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, height); + var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3()); - // //var rotMat = new Cesium.Matrix3(); - // var rotation = new Cesium.Matrix3.fromHeadingPitchRoll(new Cesium.HeadingPitchRoll(Yaw, P, R)); + //var rotMat = new Cesium.Matrix3(); + var rotation = new Cesium.Matrix3.fromHeadingPitchRoll(new Cesium.HeadingPitchRoll(Yaw, P, R)); - // stoeckach.modelMatrix = Cesium.Matrix4.fromRotationTranslation(rotation,translation); + stoeckach.modelMatrix = Cesium.Matrix4.fromRotationTranslation(rotation,translation); - // return zoomAll(stoeckach); - // }); + return zoomAll(stoeckach); + }); - // stoeckach.readyPromise.then(function(stoeckach){ - // stoeckach.style = new Cesium.Cesium3DTileStyle({ - // color: "color('white',0.5)", - // }) - // }); + stoeckach.readyPromise.then(function(stoeckach){ + stoeckach.style = new Cesium.Cesium3DTileStyle({ + color: "color('white',1)", + }) + }); @@ -138,166 +138,166 @@ $(function () { target_tileset.readyPromise.then(function(target_tileset){ target_tileset.style = new Cesium.Cesium3DTileStyle({ - color: "color('black',0.5)", + color: "color('red',0.9)", }) }); - ///////////////////////////// Layer one ////////////////////////// + // ///////////////////////////// Layer one ////////////////////////// - var L1 = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ - url: 'buildingTiles/circularTiles/L1_yellow/tileset.json', - show: true, + // var L1 = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ + // url: 'buildingTiles/circularTiles/L1_yellow/tileset.json', + // show: true, - })); + // })); - L1.readyPromise.then(function (L1) { - return zoomAll(L1); - }); + // L1.readyPromise.then(function (L1) { + // return zoomAll(L1); + // }); - L1.readyPromise.then(function (L1) { + // L1.readyPromise.then(function (L1) { - var R = 0; // roll - var P = 0; // pitch - var Yaw = 0; // yaw - var height = buildingHeightOffset; - var cartographic = Cesium.Cartographic.fromCartesian(L1.boundingSphere.center); - var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0); - var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, height); - var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3()); + // var R = 0; // roll + // var P = 0; // pitch + // var Yaw = 0; // yaw + // var height = buildingHeightOffset; + // var cartographic = Cesium.Cartographic.fromCartesian(L1.boundingSphere.center); + // var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0); + // var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, height); + // var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3()); - //var rotMat = new Cesium.Matrix3(); - var rotation = new Cesium.Matrix3.fromHeadingPitchRoll(new Cesium.HeadingPitchRoll(Yaw, P, R)); + // //var rotMat = new Cesium.Matrix3(); + // var rotation = new Cesium.Matrix3.fromHeadingPitchRoll(new Cesium.HeadingPitchRoll(Yaw, P, R)); - L1.modelMatrix = Cesium.Matrix4.fromRotationTranslation(rotation,translation); + // L1.modelMatrix = Cesium.Matrix4.fromRotationTranslation(rotation,translation); - return zoomAll(L1); - }); + // return zoomAll(L1); + // }); - L1.readyPromise.then(function(L1){ - L1.style = new Cesium.Cesium3DTileStyle({ - color: "color('yellow',1)", - }) - }); + // L1.readyPromise.then(function(L1){ + // L1.style = new Cesium.Cesium3DTileStyle({ + // color: "color('yellow',1)", + // }) + // }); - ///////////////////////////// Layer 2 ////////////////////////// + // ///////////////////////////// Layer 2 ////////////////////////// - var L2 = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ - url: 'buildingTiles/circularTiles/L2_red/tileset.json', - show: true, + // var L2 = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ + // url: 'buildingTiles/circularTiles/L2_red/tileset.json', + // show: true, - })); + // })); - L2.readyPromise.then(function (L2) { - return zoomAll(L2); - }); + // L2.readyPromise.then(function (L2) { + // return zoomAll(L2); + // }); - L2.readyPromise.then(function (L2) { + // L2.readyPromise.then(function (L2) { - var R = 0; // roll - var P = 0; // pitch - var Yaw = 0; // yaw - var height = buildingHeightOffset; - var cartographic = Cesium.Cartographic.fromCartesian(L2.boundingSphere.center); - var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0); - var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, height); - var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3()); + // var R = 0; // roll + // var P = 0; // pitch + // var Yaw = 0; // yaw + // var height = buildingHeightOffset; + // var cartographic = Cesium.Cartographic.fromCartesian(L2.boundingSphere.center); + // var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0); + // var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, height); + // var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3()); - //var rotMat = new Cesium.Matrix3(); - var rotation = new Cesium.Matrix3.fromHeadingPitchRoll(new Cesium.HeadingPitchRoll(Yaw, P, R)); + // //var rotMat = new Cesium.Matrix3(); + // var rotation = new Cesium.Matrix3.fromHeadingPitchRoll(new Cesium.HeadingPitchRoll(Yaw, P, R)); - L2.modelMatrix = Cesium.Matrix4.fromRotationTranslation(rotation,translation); + // L2.modelMatrix = Cesium.Matrix4.fromRotationTranslation(rotation,translation); - return zoomAll(L2); - }); + // return zoomAll(L2); + // }); - L2.readyPromise.then(function(L2){ - L2.style = new Cesium.Cesium3DTileStyle({ - color: "color('red',1)", - }) - }); + // L2.readyPromise.then(function(L2){ + // L2.style = new Cesium.Cesium3DTileStyle({ + // color: "color('red',1)", + // }) + // }); - ///////////////////////////// Layer 3 ////////////////////////// + // ///////////////////////////// Layer 3 ////////////////////////// - var L3 = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ - url: 'buildingTiles/circularTiles/L3_green/tileset.json', - show: true, + // var L3 = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ + // url: 'buildingTiles/circularTiles/L3_green/tileset.json', + // show: true, - })); + // })); - L3.readyPromise.then(function (L3) { - return zoomAll(L3); - }); + // L3.readyPromise.then(function (L3) { + // return zoomAll(L3); + // }); - L3.readyPromise.then(function (L3) { + // L3.readyPromise.then(function (L3) { - var R = 0; // roll - var P = 0; // pitch - var Yaw = 0; // yaw - var height = buildingHeightOffset; - var cartographic = Cesium.Cartographic.fromCartesian(L3.boundingSphere.center); - var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0); - var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, height); - var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3()); + // var R = 0; // roll + // var P = 0; // pitch + // var Yaw = 0; // yaw + // var height = buildingHeightOffset; + // var cartographic = Cesium.Cartographic.fromCartesian(L3.boundingSphere.center); + // var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0); + // var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, height); + // var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3()); - //var rotMat = new Cesium.Matrix3(); - var rotation = new Cesium.Matrix3.fromHeadingPitchRoll(new Cesium.HeadingPitchRoll(Yaw, P, R)); + // //var rotMat = new Cesium.Matrix3(); + // var rotation = new Cesium.Matrix3.fromHeadingPitchRoll(new Cesium.HeadingPitchRoll(Yaw, P, R)); - L3.modelMatrix = Cesium.Matrix4.fromRotationTranslation(rotation,translation); + // L3.modelMatrix = Cesium.Matrix4.fromRotationTranslation(rotation,translation); - return zoomAll(L3); - }); + // return zoomAll(L3); + // }); - L3.readyPromise.then(function(L3){ - L3.style = new Cesium.Cesium3DTileStyle({ - color: "color('green',1)", - }) - }); + // L3.readyPromise.then(function(L3){ + // L3.style = new Cesium.Cesium3DTileStyle({ + // color: "color('green',1)", + // }) + // }); - ///////////////////////////// Layer 3 ////////////////////////// + // ///////////////////////////// Layer 3 ////////////////////////// - var L4 = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ - url: 'buildingTiles/circularTiles/L4_brown/tileset.json', - show: true, + // var L4 = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ + // url: 'buildingTiles/circularTiles/L4_brown/tileset.json', + // show: true, - })); + // })); - L4.readyPromise.then(function (L4) { - return zoomAll(L4); - }); + // L4.readyPromise.then(function (L4) { + // return zoomAll(L4); + // }); - L4.readyPromise.then(function (L4) { + // L4.readyPromise.then(function (L4) { - var R = 0; // roll - var P = 0; // pitch - var Yaw = 0; // yaw - var height = buildingHeightOffset; - var cartographic = Cesium.Cartographic.fromCartesian(L4.boundingSphere.center); - var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0); - var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, height); - var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3()); + // var R = 0; // roll + // var P = 0; // pitch + // var Yaw = 0; // yaw + // var height = buildingHeightOffset; + // var cartographic = Cesium.Cartographic.fromCartesian(L4.boundingSphere.center); + // var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0); + // var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, height); + // var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3()); - //var rotMat = new Cesium.Matrix3(); - var rotation = new Cesium.Matrix3.fromHeadingPitchRoll(new Cesium.HeadingPitchRoll(Yaw, P, R)); + // //var rotMat = new Cesium.Matrix3(); + // var rotation = new Cesium.Matrix3.fromHeadingPitchRoll(new Cesium.HeadingPitchRoll(Yaw, P, R)); - L4.modelMatrix = Cesium.Matrix4.fromRotationTranslation(rotation,translation); + // L4.modelMatrix = Cesium.Matrix4.fromRotationTranslation(rotation,translation); - return zoomAll(L4); - }); + // return zoomAll(L4); + // }); - L4.readyPromise.then(function(L4){ - L4.style = new Cesium.Cesium3DTileStyle({ - color: "color('CORAL',1)", - }) - }); + // L4.readyPromise.then(function(L4){ + // L4.style = new Cesium.Cesium3DTileStyle({ + // color: "color('CORAL',1)", + // }) + // }); var camera = viewer.camera; diff --git a/public/circData.js b/public/circData.js index b352898..4add6a3 100644 --- a/public/circData.js +++ b/public/circData.js @@ -66,45 +66,41 @@ $(function () { canvas.focus(); var scene = viewer.scene; - - - - -// viewer.scene.globe.depthTestAgainstTerrain = false; - -// var osmBuildings = Cesium.createOsmBuildings(); -// osmBuildings.readyPromise -// .then(function (osmBuildings) { -// viewer.scene.primitives.add(osmBuildings); -// }) -// .otherwise(function (error) { -// console.log(error); -// }); - -// osmBuildings.readyPromise.then(function (osmBuildings) { -// var height = 60; -// var cartographic = Cesium.Cartographic.fromCartesian( -// osmBuildings.boundingSphere.center -// ); -// var surface = Cesium.Cartesian3.fromRadians( -// cartographic.longitude, -// cartographic.latitude, -// 0.0 -// ); -// var offset = Cesium.Cartesian3.fromRadians( -// cartographic.longitude, -// cartographic.latitude, -// height -// ); -// var translation = Cesium.Cartesian3.subtract( -// offset, -// surface, -// new Cesium.Cartesian3() -// ); - -// osmBuildings.modelMatrix = Cesium.Matrix4.fromTranslation(translation); - -// }); + // viewer.scene.globe.depthTestAgainstTerrain = false; + + // var osmBuildings = Cesium.createOsmBuildings(); + // osmBuildings.readyPromise + // .then(function (osmBuildings) { + // viewer.scene.primitives.add(osmBuildings); + // }) + // .otherwise(function (error) { + // console.log(error); + // }); + + // osmBuildings.readyPromise.then(function (osmBuildings) { + // var height = 60; + // var cartographic = Cesium.Cartographic.fromCartesian( + // osmBuildings.boundingSphere.center + // ); + // var surface = Cesium.Cartesian3.fromRadians( + // cartographic.longitude, + // cartographic.latitude, + // 0.0 + // ); + // var offset = Cesium.Cartesian3.fromRadians( + // cartographic.longitude, + // cartographic.latitude, + // height + // ); + // var translation = Cesium.Cartesian3.subtract( + // offset, + // surface, + // new Cesium.Cartesian3() + // ); + + // osmBuildings.modelMatrix = Cesium.Matrix4.fromTranslation(translation); + + // }); // viewer.terrainProvider = new Cesium.CesiumTerrainProvider({ // url: Cesium.IonResource.fromAssetId(1) @@ -112,36 +108,33 @@ $(function () { const buildingHeightOffset = 55; //53 - + // -------------------------------------------------------------------- + var relativeHeight = 0.0; + var scale = 1.5; - -// -------------------------------------------------------------------- -var relativeHeight = 0.0; -var scale = 1.5 - -function getEastNorthUpTransform(tileset, relativeHeight) { + function getEastNorthUpTransform(tileset, relativeHeight) { var origin = tileset.boundingSphere.center; var cartographic = Cesium.Cartographic.fromCartesian(origin); cartographic.height = relativeHeight; origin = Cesium.Cartographic.toCartesian(cartographic); var enu = Cesium.Transforms.eastNorthUpToFixedFrame(origin); return enu; -} + } -function getScaleTransform(tileset, scale, relativeHeight) { + function getScaleTransform(tileset, scale, relativeHeight) { var toGlobal = getEastNorthUpTransform(tileset, relativeHeight); var toLocal = Cesium.Matrix4.inverse(toGlobal, new Cesium.Matrix4()); var localScale = new Cesium.Cartesian3(scale, scale, scale); var localScaleMatrix = Cesium.Matrix4.fromScale(localScale); - var transform = Cesium.Matrix4.multiply(toGlobal, Cesium.Matrix4.multiply(localScaleMatrix, toLocal, new Cesium.Matrix4()), new Cesium.Matrix4()); + var transform = Cesium.Matrix4.multiply( + toGlobal, + Cesium.Matrix4.multiply(localScaleMatrix, toLocal, new Cesium.Matrix4()), + new Cesium.Matrix4() + ); return transform; -} - - - -////////////////////////////////////////////////////////////////////// - + } + ////////////////////////////////////////////////////////////////////// ///////////////////////////// Target ////////////////////////// @@ -153,7 +146,6 @@ function getScaleTransform(tileset, scale, relativeHeight) { ); target_tileset.readyPromise.then(function (target_tileset) { - var height = buildingHeightOffset; var cartographic = Cesium.Cartographic.fromCartesian( target_tileset.boundingSphere.center @@ -174,262 +166,258 @@ function getScaleTransform(tileset, scale, relativeHeight) { new Cesium.Cartesian3() ); - - target_tileset.modelMatrix = Cesium.Matrix4.fromTranslation( - translation - ); - - + target_tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation); + return zoomAll(target_tileset); }); target_tileset.readyPromise.then(function (target_tileset) { target_tileset.style = new Cesium.Cesium3DTileStyle({ - color: "color('black',0.5)", + color: "color('red',0.9)", }); }); -// target_tileset.root.transform = getScaleTransform(target_tileset, scale, relativeHeight); + // target_tileset.root.transform = getScaleTransform(target_tileset, scale, relativeHeight); - ///////////////////////////// Layer one ////////////////////////// + // ///////////////////////////// Layer one ////////////////////////// - var L1 = viewer.scene.primitives.add( - new Cesium.Cesium3DTileset({ - url: "buildingTiles/circularTiles/L1_yellow/tileset.json", - show: true, - }) - ); + // var L1 = viewer.scene.primitives.add( + // new Cesium.Cesium3DTileset({ + // url: "buildingTiles/circularTiles/L1_yellow/tileset.json", + // show: true, + // }) + // ); - L1.readyPromise.then(function (L1) { - return zoomAll(L1); - }); + // L1.readyPromise.then(function (L1) { + // return zoomAll(L1); + // }); - L1.readyPromise.then(function (L1) { - var R = 0; // roll - var P = 0; // pitch - var Yaw = 0; // yaw - var height = buildingHeightOffset; - var cartographic = Cesium.Cartographic.fromCartesian( - L1.boundingSphere.center - ); - var surface = Cesium.Cartesian3.fromRadians( - cartographic.longitude, - cartographic.latitude, - 0.0 - ); - var offset = Cesium.Cartesian3.fromRadians( - cartographic.longitude, - cartographic.latitude, - height - ); - var translation = Cesium.Cartesian3.subtract( - offset, - surface, - new Cesium.Cartesian3() - ); + // L1.readyPromise.then(function (L1) { + // var R = 0; // roll + // var P = 0; // pitch + // var Yaw = 0; // yaw + // var height = buildingHeightOffset; + // var cartographic = Cesium.Cartographic.fromCartesian( + // L1.boundingSphere.center + // ); + // var surface = Cesium.Cartesian3.fromRadians( + // cartographic.longitude, + // cartographic.latitude, + // 0.0 + // ); + // var offset = Cesium.Cartesian3.fromRadians( + // cartographic.longitude, + // cartographic.latitude, + // height + // ); + // var translation = Cesium.Cartesian3.subtract( + // offset, + // surface, + // new Cesium.Cartesian3() + // ); - //var rotMat = new Cesium.Matrix3(); - var rotation = new Cesium.Matrix3.fromHeadingPitchRoll( - new Cesium.HeadingPitchRoll(Yaw, P, R) - ); + // //var rotMat = new Cesium.Matrix3(); + // var rotation = new Cesium.Matrix3.fromHeadingPitchRoll( + // new Cesium.HeadingPitchRoll(Yaw, P, R) + // ); - L1.modelMatrix = Cesium.Matrix4.fromRotationTranslation( - rotation, - translation - ); + // L1.modelMatrix = Cesium.Matrix4.fromRotationTranslation( + // rotation, + // translation + // ); - return zoomAll(L1); - }); + // return zoomAll(L1); + // }); - L1.readyPromise.then(function (L1) { - L1.style = new Cesium.Cesium3DTileStyle({ - color: "color('yellow',1)", - }); - }); + // L1.readyPromise.then(function (L1) { + // L1.style = new Cesium.Cesium3DTileStyle({ + // color: "color('yellow',1)", + // }); + // }); - ///////////////////////////// Layer 2 ////////////////////////// + // ///////////////////////////// Layer 2 ////////////////////////// - var L2 = viewer.scene.primitives.add( - new Cesium.Cesium3DTileset({ - url: "buildingTiles/circularTiles/L2_red/tileset.json", - show: true, - }) - ); + // var L2 = viewer.scene.primitives.add( + // new Cesium.Cesium3DTileset({ + // url: "buildingTiles/circularTiles/L2_red/tileset.json", + // show: true, + // }) + // ); - L2.readyPromise.then(function (L2) { - return zoomAll(L2); - }); + // L2.readyPromise.then(function (L2) { + // return zoomAll(L2); + // }); - L2.readyPromise.then(function (L2) { - var R = 0; // roll - var P = 0; // pitch - var Yaw = 0; // yaw - var height = buildingHeightOffset; - var cartographic = Cesium.Cartographic.fromCartesian( - L2.boundingSphere.center - ); - var surface = Cesium.Cartesian3.fromRadians( - cartographic.longitude, - cartographic.latitude, - 0.0 - ); - var offset = Cesium.Cartesian3.fromRadians( - cartographic.longitude, - cartographic.latitude, - height - ); - var translation = Cesium.Cartesian3.subtract( - offset, - surface, - new Cesium.Cartesian3() - ); + // L2.readyPromise.then(function (L2) { + // var R = 0; // roll + // var P = 0; // pitch + // var Yaw = 0; // yaw + // var height = buildingHeightOffset; + // var cartographic = Cesium.Cartographic.fromCartesian( + // L2.boundingSphere.center + // ); + // var surface = Cesium.Cartesian3.fromRadians( + // cartographic.longitude, + // cartographic.latitude, + // 0.0 + // ); + // var offset = Cesium.Cartesian3.fromRadians( + // cartographic.longitude, + // cartographic.latitude, + // height + // ); + // var translation = Cesium.Cartesian3.subtract( + // offset, + // surface, + // new Cesium.Cartesian3() + // ); - //var rotMat = new Cesium.Matrix3(); - var rotation = new Cesium.Matrix3.fromHeadingPitchRoll( - new Cesium.HeadingPitchRoll(Yaw, P, R) - ); + // //var rotMat = new Cesium.Matrix3(); + // var rotation = new Cesium.Matrix3.fromHeadingPitchRoll( + // new Cesium.HeadingPitchRoll(Yaw, P, R) + // ); - L2.modelMatrix = Cesium.Matrix4.fromRotationTranslation( - rotation, - translation - ); + // L2.modelMatrix = Cesium.Matrix4.fromRotationTranslation( + // rotation, + // translation + // ); - return zoomAll(L2); - }); + // return zoomAll(L2); + // }); - L2.readyPromise.then(function (L2) { - L2.style = new Cesium.Cesium3DTileStyle({ - color: "color('red',1)", - }); - }); + // L2.readyPromise.then(function (L2) { + // L2.style = new Cesium.Cesium3DTileStyle({ + // color: "color('red',1)", + // }); + // }); - ///////////////////////////// Layer 3 ////////////////////////// + // ///////////////////////////// Layer 3 ////////////////////////// - var L3 = viewer.scene.primitives.add( - new Cesium.Cesium3DTileset({ - url: "buildingTiles/circularTiles/L3_green/tileset.json", - show: true, - }) - ); + // var L3 = viewer.scene.primitives.add( + // new Cesium.Cesium3DTileset({ + // url: "buildingTiles/circularTiles/L3_green/tileset.json", + // show: true, + // }) + // ); - L3.readyPromise.then(function (L3) { - return zoomAll(L3); - }); + // L3.readyPromise.then(function (L3) { + // return zoomAll(L3); + // }); - L3.readyPromise.then(function (L3) { - var R = 0; // roll - var P = 0; // pitch - var Yaw = 0; // yaw - var height = buildingHeightOffset; - var cartographic = Cesium.Cartographic.fromCartesian( - L3.boundingSphere.center - ); - var surface = Cesium.Cartesian3.fromRadians( - cartographic.longitude, - cartographic.latitude, - 0.0 - ); - var offset = Cesium.Cartesian3.fromRadians( - cartographic.longitude, - cartographic.latitude, - height - ); - var translation = Cesium.Cartesian3.subtract( - offset, - surface, - new Cesium.Cartesian3() - ); + // L3.readyPromise.then(function (L3) { + // var R = 0; // roll + // var P = 0; // pitch + // var Yaw = 0; // yaw + // var height = buildingHeightOffset; + // var cartographic = Cesium.Cartographic.fromCartesian( + // L3.boundingSphere.center + // ); + // var surface = Cesium.Cartesian3.fromRadians( + // cartographic.longitude, + // cartographic.latitude, + // 0.0 + // ); + // var offset = Cesium.Cartesian3.fromRadians( + // cartographic.longitude, + // cartographic.latitude, + // height + // ); + // var translation = Cesium.Cartesian3.subtract( + // offset, + // surface, + // new Cesium.Cartesian3() + // ); - //var rotMat = new Cesium.Matrix3(); - var rotation = new Cesium.Matrix3.fromHeadingPitchRoll( - new Cesium.HeadingPitchRoll(Yaw, P, R) - ); + // //var rotMat = new Cesium.Matrix3(); + // var rotation = new Cesium.Matrix3.fromHeadingPitchRoll( + // new Cesium.HeadingPitchRoll(Yaw, P, R) + // ); - L3.modelMatrix = Cesium.Matrix4.fromRotationTranslation( - rotation, - translation - ); + // L3.modelMatrix = Cesium.Matrix4.fromRotationTranslation( + // rotation, + // translation + // ); - return zoomAll(L3); - }); + // return zoomAll(L3); + // }); - L3.readyPromise.then(function (L3) { - L3.style = new Cesium.Cesium3DTileStyle({ - color: "color('green',1)", - }); - }); + // L3.readyPromise.then(function (L3) { + // L3.style = new Cesium.Cesium3DTileStyle({ + // color: "color('green',1)", + // }); + // }); - ///////////////////////////// Layer 3 ////////////////////////// + // ///////////////////////////// Layer 3 ////////////////////////// - var L4 = viewer.scene.primitives.add( - new Cesium.Cesium3DTileset({ - url: "buildingTiles/circularTiles/L4_brown/tileset.json", - show: true, - }) - ); + // var L4 = viewer.scene.primitives.add( + // new Cesium.Cesium3DTileset({ + // url: "buildingTiles/circularTiles/L4_brown/tileset.json", + // show: true, + // }) + // ); - L4.readyPromise.then(function (L4) { - return zoomAll(L4); - }); + // L4.readyPromise.then(function (L4) { + // return zoomAll(L4); + // }); - L4.readyPromise.then(function (L4) { - var R = 0; // roll - var P = 0; // pitch - var Yaw = 0; // yaw - var height = buildingHeightOffset; - var cartographic = Cesium.Cartographic.fromCartesian( - L4.boundingSphere.center - ); - var surface = Cesium.Cartesian3.fromRadians( - cartographic.longitude, - cartographic.latitude, - 0.0 - ); - var offset = Cesium.Cartesian3.fromRadians( - cartographic.longitude, - cartographic.latitude, - height - ); - var translation = Cesium.Cartesian3.subtract( - offset, - surface, - new Cesium.Cartesian3() - ); + // L4.readyPromise.then(function (L4) { + // var R = 0; // roll + // var P = 0; // pitch + // var Yaw = 0; // yaw + // var height = buildingHeightOffset; + // var cartographic = Cesium.Cartographic.fromCartesian( + // L4.boundingSphere.center + // ); + // var surface = Cesium.Cartesian3.fromRadians( + // cartographic.longitude, + // cartographic.latitude, + // 0.0 + // ); + // var offset = Cesium.Cartesian3.fromRadians( + // cartographic.longitude, + // cartographic.latitude, + // height + // ); + // var translation = Cesium.Cartesian3.subtract( + // offset, + // surface, + // new Cesium.Cartesian3() + // ); - //var rotMat = new Cesium.Matrix3(); - var rotation = new Cesium.Matrix3.fromHeadingPitchRoll( - new Cesium.HeadingPitchRoll(Yaw, P, R) - ); + // //var rotMat = new Cesium.Matrix3(); + // var rotation = new Cesium.Matrix3.fromHeadingPitchRoll( + // new Cesium.HeadingPitchRoll(Yaw, P, R) + // ); - L4.modelMatrix = Cesium.Matrix4.fromRotationTranslation( - rotation, - translation - ); + // L4.modelMatrix = Cesium.Matrix4.fromRotationTranslation( + // rotation, + // translation + // ); - return zoomAll(L4); - }); + // return zoomAll(L4); + // }); - L4.readyPromise.then(function (L4) { - L4.style = new Cesium.Cesium3DTileStyle({ - color: "color('CORAL',1)", - }); - }); + // L4.readyPromise.then(function (L4) { + // L4.style = new Cesium.Cesium3DTileStyle({ + // color: "color('CORAL',1)", + // }); + // }); - var camera = viewer.camera; - var controller = scene.screenSpaceCameraController; - var r = 0; - var center = new Cesium.Cartesian3(); - - var hpRoll = new Cesium.HeadingPitchRoll(); - var hpRange = new Cesium.HeadingPitchRange(); - var speed = 0.1; - var deltaRadians = Cesium.Math.toRadians(3.0); - - var position = Cesium.Cartesian3.fromDegrees(9.190471, 48.786782, 0.0); - var speedVector = new Cesium.Cartesian3(); - var fixedFrameTransform = Cesium.Transforms.localFrameToFixedFrameGenerator( - "north", - "west" - ); + // var camera = viewer.camera; + // var controller = scene.screenSpaceCameraController; + // var r = 0; + // var center = new Cesium.Cartesian3(); + + // var hpRoll = new Cesium.HeadingPitchRoll(); + // var hpRange = new Cesium.HeadingPitchRange(); + // var speed = 0.1; + // var deltaRadians = Cesium.Math.toRadians(3.0); + + // var position = Cesium.Cartesian3.fromDegrees(9.190471, 48.786782, 0.0); + // var speedVector = new Cesium.Cartesian3(); + // var fixedFrameTransform = Cesium.Transforms.localFrameToFixedFrameGenerator( + // "north", + // "west" + // ); viewer.scene.globe.enableLighting = true; // set lighting to true @@ -447,31 +435,46 @@ function getScaleTransform(tileset, scale, relativeHeight) { }); }; - ///////////////// STOECKACH LOD 1 + ///////////////// STOECKACH LOD 1 - var stoeckach = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ - url: 'buildingTiles/StoeckachLOD1/tileset.json', - show: true -})); - -stoeckach.readyPromise.then(function (stoeckach) { + var stoeckach = viewer.scene.primitives.add( + new Cesium.Cesium3DTileset({ + url: "buildingTiles/StoeckachLOD1/tileset.json", + show: true, + }) + ); - - var height = buildingHeightOffset-1; - var cartographic = Cesium.Cartographic.fromCartesian(stoeckach.boundingSphere.center); - var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0); - var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, height); - var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3()); + stoeckach.readyPromise.then(function (stoeckach) { + var height = buildingHeightOffset - 1; + var cartographic = Cesium.Cartographic.fromCartesian( + stoeckach.boundingSphere.center + ); + var surface = Cesium.Cartesian3.fromRadians( + cartographic.longitude, + cartographic.latitude, + 0.0 + ); + var offset = Cesium.Cartesian3.fromRadians( + cartographic.longitude, + cartographic.latitude, + height + ); + var translation = Cesium.Cartesian3.subtract( + offset, + surface, + new Cesium.Cartesian3() + ); - stoeckach.modelMatrix = Cesium.Matrix4.fromTranslation(translation); + stoeckach.modelMatrix = Cesium.Matrix4.fromTranslation(translation); -}); + return zoomAll(stoeckach); + }); -stoeckach.readyPromise.then(function(stoeckach){ - stoeckach.style = new Cesium.Cesium3DTileStyle({ - color: "color('white',1)", - }) -}); + stoeckach.readyPromise.then(function (stoeckach) { + stoeckach.style = new Cesium.Cesium3DTileStyle({ + color: "color('white',1)", + }); + }); // load streamline data from text file and parse it to polyline with multiple colors. diff --git a/public/index.html b/public/index.html index 2fcdad1..e2defc8 100644 --- a/public/index.html +++ b/public/index.html @@ -270,7 +270,7 @@
-

Visualisation of wind around three target buildings (black) near a church with spire and surrounded by numerous building layers (colors). The streamlines results from a Computational Fluid Dynamic simulation of the air flow with RANS (Reynold-Averaged Navier Stokes Equations) and the k-omega SST Turbulence model.

+

Visualisation of wind around three target buildings (red) near a church with spire and surrounded by numerous building layers (colors). The streamlines results from a Computational Fluid Dynamic simulation of the air flow with RANS (Reynold-Averaged Navier Stokes Equations) and the k-omega SST Turbulence model.

@@ -299,7 +299,7 @@
-

Wind visualisation with particles around three target buildings (black) near a church with spire and surrounded by numerous building layers (colors). The streamlines results from a Computational Fluid Dynamic simulation of the air flow with RANS (Reynold-Averaged Navier Stokes Equations) and the k-omega SST Turbulence model.

+

Wind visualisation with particles around three target buildings (red) near a church with spire and surrounded by numerous building layers (colors). The streamlines results from a Computational Fluid Dynamic simulation of the air flow with RANS (Reynold-Averaged Navier Stokes Equations) and the k-omega SST Turbulence model.

@@ -317,7 +317,7 @@
-

Wind visualisation with particles around three target buildings (black) near a church with spire and surrounded by numerous building layers (colors). The streamlines results from a Computational Fluid Dynamic simulation of the air flow with RANS (Reynold-Averaged Navier Stokes Equations) and the k-omega SST Turbulence model.

+

Wind visualisation with particles around three target buildings (red) near a church with spire and surrounded by numerous building layers (colors). The streamlines results from a Computational Fluid Dynamic simulation of the air flow with RANS (Reynold-Averaged Navier Stokes Equations) and the k-omega SST Turbulence model.

-- GitLab