Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Sven Schneider
urbanVIS
Commits
40c8e4da
Commit
40c8e4da
authored
Mar 31, 2022
by
Sven Schneider
Browse files
added a small test obj in HFT innnenhof
parent
37b3ab0d
Pipeline
#6080
passed with stages
in 17 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
public/Testgebiete.js
View file @
40c8e4da
...
...
@@ -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
()
{
tilesetLOD
1
=
viewer
.
scene
.
primitives
.
add
(
new
Cesium
.
Cesium3DTileset
({
tilesetLOD
3
=
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),
}));
Cesium
.
when
(
tilesetLOD
1
.
readyPromise
).
then
(
function
(
tilesetLOD
1
)
{
viewer
.
flyTo
(
tilesetLOD
1
)
tilesetLOD
1
.
style
=
new
Cesium
.
Cesium3DTileStyle
({
Cesium
.
when
(
tilesetLOD
3
.
readyPromise
).
then
(
function
(
tilesetLOD
3
)
{
viewer
.
flyTo
(
tilesetLOD
3
)
tilesetLOD
3
.
style
=
new
Cesium
.
Cesium3DTileStyle
({
color
:
{
conditions
:
[
[
"
${featureType} === 'Window'
"
,
"
color('blue')
"
],
...
...
@@ -73,18 +115,18 @@ var zoomAll = function (tileset) {
},
show
:
true
});
// tilesetLOD
1
.style = new Cesium.Cesium3DTileStyle({
// tilesetLOD
3
.style = new Cesium.Cesium3DTileStyle({
// color: "color('BLACK', 0.3)",
// show: true
// });
var
heightOffset
=
50
.0
;
var
boundingSphere
=
tilesetLOD
1
.
boundingSphere
;
var
heightOffset
=
49
.0
;
var
boundingSphere
=
tilesetLOD
3
.
boundingSphere
;
var
cartographic
=
Cesium
.
Cartographic
.
fromCartesian
(
boundingSphere
.
center
);
var
surface
=
Cesium
.
Cartesian3
.
fromRadians
(
cartographic
.
longitude
,
cartographic
.
latitude
,
0.0
);
var
offset
=
Cesium
.
Cartesian3
.
fromRadians
(
cartographic
.
longitude
,
cartographic
.
latitude
,
heightOffset
);
var
translation
=
Cesium
.
Cartesian3
.
subtract
(
offset
,
surface
,
new
Cesium
.
Cartesian3
());
tilesetLOD
1
.
modelMatrix
=
Cesium
.
Matrix4
.
fromTranslation
(
translation
);
tilesetLOD
3
.
modelMatrix
=
Cesium
.
Matrix4
.
fromTranslation
(
translation
);
})
}
...
...
@@ -95,7 +137,7 @@ var zoomAll = function (tileset) {
//////// important value. to find the correct value trail and error is needed for a perfect fit
const
BUILDIG_TILESET_HEIGHT_OFFSET
=
5
4
;
const
BUILDIG_TILESET_HEIGHT_OFFSET
=
5
0
;
tileset
.
readyPromise
.
then
(
function
(
tileset
)
{
var
height
=
BUILDIG_TILESET_HEIGHT_OFFSET
;
...
...
@@ -211,9 +253,9 @@ var toggleBuildingTiles = function () {
}
else
{
tileset
.
show
=
true
if
(
tilesetLOD
1
.
show
===
true
){
if
(
tilesetLOD
3
.
show
===
true
){
$
(
'
#prettyBuildingsCheckbox
'
).
prop
(
'
checked
'
,
false
);
tilesetLOD
1
.
show
=
false
tilesetLOD
3
.
show
=
false
}
}
}
...
...
@@ -246,12 +288,12 @@ var toggleFellbachTexturedTiles = function () {
}
var
togglePrettyBuildingTiles
=
function
()
{
// tilesetLOD
1
.show = tilesetLOD
1
.show ? false : true;
if
(
tilesetLOD
1
.
show
===
true
)
{
tilesetLOD
1
.
show
=
false
// tilesetLOD
3
.show = tilesetLOD
3
.show ? false : true;
if
(
tilesetLOD
3
.
show
===
true
)
{
tilesetLOD
3
.
show
=
false
}
else
{
tilesetLOD
1
.
show
=
true
tilesetLOD
3
.
show
=
true
if
(
tileset
.
show
===
true
){
$
(
'
#simpleBuildingsCheckbox
'
).
prop
(
'
checked
'
,
false
);
tileset
.
show
=
false
...
...
@@ -371,7 +413,7 @@ var togglePrettyBuildingTiles = function () {
Cesium
.
Camera
.
DEFAULT_VIEW_RECTANGLE
=
extent
;
Cesium
.
Camera
.
DEFAULT_VIEW_FACTOR
=
0
;
viewer
.
flyTo
(
tilesetLOD
1
);
viewer
.
flyTo
(
tilesetLOD
3
);
...
...
public/buildingTiles/HFT_testbld/b3dms/R.b3dm
0 → 100644
View file @
40c8e4da
File added
public/buildingTiles/HFT_testbld/tileset.json
0 → 100644
View file @
40c8e4da
{
"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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment