Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Mir
Visualization
Commits
2158f0da
Commit
2158f0da
authored
2 years ago
by
Joe TS Dell
Browse files
Options
Download
Email Patches
Plain Diff
update
parent
2aee5012
master
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
example.html
+41
-0
example.html
with
41 additions
and
0 deletions
+41
-0
example.html
0 → 100644
+
41
-
0
View file @
2158f0da
<html
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
>
<script
src=
"https://cesium.com/downloads/cesiumjs/releases/1.92/Build/Cesium/Cesium.js"
></script>
<link
href=
"https://cesium.com/downloads/cesiumjs/releases/1.92/Build/Cesium/Widgets/widgets.css"
rel=
"stylesheet"
>
</head>
<body>
<div
id=
"cesiumContainer"
style=
"width: 100%; height:100%"
></div>
<script>
// Cesium.Ion.defaultAccessToken = '
<
Your
Access
Token
Here
>
'
;
var viewer = new Cesium.Viewer(
'
cesiumContainer
'
, {
baseLayerPicker: true,
vrButton: true,
geocoder: false,
navigationHelpButton: false,
selectionIndicator: false,
shadows: true,
timeline: true,
sceneModePicker: true,
});
var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
url: "tileset/tileset.json"
}))
Cesium.when(tileset.readyPromise).then(function (tileset) {
viewer.flyTo(tileset)
var heightOffset = -20.0;
var boundingSphere = tileset.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());
tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation);
})
</script>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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
Menu
Explore
Projects
Groups
Snippets