Commit 40c8e4da authored by Sven Schneider's avatar Sven Schneider
Browse files

added a small test obj in HFT innnenhof

parent 37b3ab0d
Pipeline #6080 passed with stages
in 17 seconds
...@@ -51,17 +51,59 @@ var zoomAll = function (tileset) { ...@@ -51,17 +51,59 @@ var zoomAll = function (tileset) {
// var HFT_testbld = viewer.scene.primitives.add(
// new Cesium.Cesium3DTileset({
// url: Cesium.IonResource.fromAssetId(905706),
// })
// );
var HFT_testbld = viewer.scene.primitives.add(
new Cesium.Cesium3DTileset({
url: "buildingTiles/HFT_testbld/tileset.json",
show: true,
})
);
HFT_testbld.readyPromise.then(function (HFT_testbld) {
var height =55;
var cartographic = Cesium.Cartographic.fromCartesian(
HFT_testbld.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()
);
// now shift / translate the tileset by the translation vector defined above
HFT_testbld.modelMatrix = Cesium.Matrix4.fromTranslation(translation);
return zoomAll(HFT_testbld); // zoom or rather go to the translated tileset
});
var load3DTiles = function () { var load3DTiles = function () {
tilesetLOD1 = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ tilesetLOD3 = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
url: "https://steinbeis-3dps.eu/3DGeoVolumes/collections/Stuttgart/HFTBuildings_3DModel_noTexture/3dtiles/tileset.json", //Cesium.IonResource.fromAssetId(656401), url: "https://steinbeis-3dps.eu/3DGeoVolumes/collections/Stuttgart/HFTBuildings_3DModel_noTexture/3dtiles/tileset.json", //Cesium.IonResource.fromAssetId(656401),
})); }));
Cesium.when(tilesetLOD1.readyPromise).then(function (tilesetLOD1) { Cesium.when(tilesetLOD3.readyPromise).then(function (tilesetLOD3) {
viewer.flyTo(tilesetLOD1) viewer.flyTo(tilesetLOD3)
tilesetLOD1.style = new Cesium.Cesium3DTileStyle({ tilesetLOD3.style = new Cesium.Cesium3DTileStyle({
color: { color: {
conditions: [ conditions: [
["${featureType} === 'Window'", "color('blue')"], ["${featureType} === 'Window'", "color('blue')"],
...@@ -73,18 +115,18 @@ var zoomAll = function (tileset) { ...@@ -73,18 +115,18 @@ var zoomAll = function (tileset) {
}, },
show: true show: true
}); });
// tilesetLOD1.style = new Cesium.Cesium3DTileStyle({ // tilesetLOD3.style = new Cesium.Cesium3DTileStyle({
// color: "color('BLACK', 0.3)", // color: "color('BLACK', 0.3)",
// show: true // show: true
// }); // });
var heightOffset = 50.0; var heightOffset = 49.0;
var boundingSphere = tilesetLOD1.boundingSphere; var boundingSphere = tilesetLOD3.boundingSphere;
var cartographic = Cesium.Cartographic.fromCartesian(boundingSphere.center); var cartographic = Cesium.Cartographic.fromCartesian(boundingSphere.center);
var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0); var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0);
var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, heightOffset); var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, heightOffset);
var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3()); var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3());
tilesetLOD1.modelMatrix = Cesium.Matrix4.fromTranslation(translation); tilesetLOD3.modelMatrix = Cesium.Matrix4.fromTranslation(translation);
}) })
} }
...@@ -95,7 +137,7 @@ var zoomAll = function (tileset) { ...@@ -95,7 +137,7 @@ var zoomAll = function (tileset) {
//////// important value. to find the correct value trail and error is needed for a perfect fit //////// important value. to find the correct value trail and error is needed for a perfect fit
const BUILDIG_TILESET_HEIGHT_OFFSET = 54; const BUILDIG_TILESET_HEIGHT_OFFSET = 50;
tileset.readyPromise.then(function (tileset) { tileset.readyPromise.then(function (tileset) {
var height = BUILDIG_TILESET_HEIGHT_OFFSET; var height = BUILDIG_TILESET_HEIGHT_OFFSET;
...@@ -211,9 +253,9 @@ var toggleBuildingTiles = function () { ...@@ -211,9 +253,9 @@ var toggleBuildingTiles = function () {
} }
else { else {
tileset.show = true tileset.show = true
if (tilesetLOD1.show === true){ if (tilesetLOD3.show === true){
$('#prettyBuildingsCheckbox').prop('checked', false); $('#prettyBuildingsCheckbox').prop('checked', false);
tilesetLOD1.show = false tilesetLOD3.show = false
} }
} }
} }
...@@ -246,12 +288,12 @@ var toggleFellbachTexturedTiles = function () { ...@@ -246,12 +288,12 @@ var toggleFellbachTexturedTiles = function () {
} }
var togglePrettyBuildingTiles = function () { var togglePrettyBuildingTiles = function () {
// tilesetLOD1.show = tilesetLOD1.show ? false : true; // tilesetLOD3.show = tilesetLOD3.show ? false : true;
if (tilesetLOD1.show === true) { if (tilesetLOD3.show === true) {
tilesetLOD1.show = false tilesetLOD3.show = false
} }
else { else {
tilesetLOD1.show = true tilesetLOD3.show = true
if (tileset.show === true){ if (tileset.show === true){
$('#simpleBuildingsCheckbox').prop('checked', false); $('#simpleBuildingsCheckbox').prop('checked', false);
tileset.show = false tileset.show = false
...@@ -371,7 +413,7 @@ var togglePrettyBuildingTiles = function () { ...@@ -371,7 +413,7 @@ var togglePrettyBuildingTiles = function () {
Cesium.Camera.DEFAULT_VIEW_RECTANGLE = extent; Cesium.Camera.DEFAULT_VIEW_RECTANGLE = extent;
Cesium.Camera.DEFAULT_VIEW_FACTOR = 0; Cesium.Camera.DEFAULT_VIEW_FACTOR = 0;
viewer.flyTo(tilesetLOD1); viewer.flyTo(tilesetLOD3);
......
{
"asset": {
"version": "0.0"
},
"geometricError": 16.611315407063895,
"root": {
"refine": "ADD",
"boundingVolume": {
"region": [
0.16008864671949422,
0.8513738167393398,
0.1600914408830295,
0.851375630141581,
251.0,
253.0
]
},
"content": {
"uri": "b3dms/R.b3dm",
"boundingVolume": {
"region": [
0.16008864671949422,
0.8513738167393398,
0.1600914408830295,
0.851375630141581,
251.0,
253.0
]
}
},
"geometricError": 0.0
},
"properties": {
"FeatureType": {},
"gmlID": {
"maximum": 1,
"minimum": 1
},
"Longitude": {
"maximum": 9.172563898765713,
"minimum": 9.172563898765713
},
"Latitude": {
"maximum": 48.78023038740355,
"minimum": 48.78023038740355
}
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment