Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
iCity
EnergyDashboard
Commits
8be8f752
Commit
8be8f752
authored
Jun 24, 2021
by
Pithon Kabiro
Browse files
Move function that loads gltf files
parent
fcb749b0
Changes
1
Show whitespace changes
Inline
Side-by-side
public/js/appCesium.js
View file @
8be8f752
...
...
@@ -46,33 +46,32 @@ const loadNonDetailed = function () {
loadTiles
(
URL_3DTILES
);
};
// Function for loading 3DTiles + glTF models
const
loadDetailed
=
function
()
{
// Paths to data sources
const
URL_3DTILES
=
"
data_3d/3dtiles/2_partial/tileset.json
"
;
const
URL_GLTF
=
"
data_3d/gltf
"
;
// Tileset without building 225
loadTiles
(
URL_3DTILES
);
// Function for loading glTFs
const
gltfLoad
=
function
(
gltfId
,
gltfUrl
)
{
const
modelMatrix
=
Cesium
.
Transforms
.
eastNorthUpToFixedFrame
(
Cesium
.
Cartesian3
.
fromDegrees
(
9.083385
,
48.881342
,
0
)
);
const
gltfLoad
=
function
(
gltfId
)
{
viewer
.
scene
.
primitives
.
add
(
Cesium
.
Model
.
fromGltf
({
url
:
`
${
URL_GLTF
}
/
${
gltfId
}
.gltf`
,
url
:
`
${
gltfUrl
}
/
${
gltfId
}
.gltf`
,
modelMatrix
:
modelMatrix
,
scale
:
0.0254
,
allowPicking
:
true
,
})
);
};
};
// Function for loading 3DTiles + glTF models
const
loadDetailed
=
function
()
{
// Paths to data sources
const
URL_3DTILES
=
"
data_3d/3dtiles/2_partial/tileset.json
"
;
const
URL_GLTF
=
"
data_3d/gltf
"
;
// Tileset without building 225
loadTiles
(
URL_3DTILES
);
// Load Building 225
gltfLoad
(
"
bosch_si225_3
"
);
gltfLoad
(
"
bosch_si225_3
"
,
URL_GLTF
);
// Load sensors in Building 225
const
gltfArray
=
[
...
...
@@ -112,7 +111,7 @@ const loadDetailed = function () {
"
sensor_383_v2
"
,
];
gltfArray
.
forEach
((
val
)
=>
gltfLoad
(
val
));
gltfArray
.
forEach
((
sensor
)
=>
gltfLoad
(
sensor
,
URL_GLTF
));
};
if
(
!
LOAD_DETAILED_BLDG225
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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