-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vector Tiles #4665
Merged
Merged
Vector Tiles #4665
Changes from all commits
Commits
Show all changes
425 commits
Select commit
Hold shift + click to select a range
ada9029
Change positionOffset to heightOffset, fix displaying anchor lines.
bagnell ba5197d
Merge branch '3d-tiles-vector' into vector-tiles
bagnell 7f642b8
Merge branch '3d-tiles-vector' into vector-tiles
bagnell 7e1297d
Fixes after merge.
bagnell 3171e6f
Merge branch '3d-tiles-vector' into vector-tiles
bagnell 6f30747
Fix picking vector tiles on 3D tiles.
bagnell c95c1f0
Minor picking update.
bagnell 8420743
Revert to 3D Tiles Sandcastle example from master.
bagnell f4cd9db
Update server to serve vector tiles.
bagnell c77406b
Add per-polygon minimum and maximum heights according to the spec.
bagnell 01323ba
Merge branch '3d-tiles-vector' into vector-tiles
bagnell fb0925c
Only generate batch ids when not provided.
bagnell 0991919
Merge remote-tracking branch 'origin/master' into vector-tiles
d431a69
Minor updates from review.
bagnell 7021477
Update format to use arbitrary rectangle and use provided transform.
bagnell 26bb104
Update positions with model matrix when decoding.
bagnell 22ce894
Merge branch 'instanced-tile-padding' into vector-tiles
61d410b
Merge branch 'instanced-tile-padding' into vector-tiles
d9b6b0d
Merged master.
0504033
Merge remote-tracking branch 'origin/master' into vector-tiles
cf61acd
Merge branch '3d-tiles-vector' into vector-tiles
bagnell a5c1fa9
Rename GroundPrimitiveBatch -> Vector3DTilePolygons.
bagnell b34abe3
Rename GroundPolylineBatch -> Vector3DTilePolylines.
bagnell cd25740
Add Vector3DTilePoints.
bagnell e3d4fc0
Move feature creation to primitives.
bagnell 0080112
Move style application to primitives.
bagnell 9a883f0
Create Cesium3DTilePointFeature.
bagnell 4e6dfca
Change Cesium3DTilePointFeature.color to labelColor. Update doc.
bagnell 66857bf
Fix styling points with non-generated batch ids.
bagnell 39f5098
Refactor Vector3DTilePolygon for upcoming arbitrary classification pr…
bagnell 11e2124
Add Vector3DTileBatch type to represent the renderable index ranges a…
bagnell aeece61
Merge branch '3d-tiles-vector' into vector-tiles
bagnell bd776b9
Updates after merge.
bagnell 686de4f
Fix tests after merge and temporarily disable vector tile tests.
bagnell c76f9bd
Fix jitter.
bagnell 82b7b36
Fix styling.
bagnell f7e16f4
Fix initial batching by color.
bagnell 93dfdd8
Fix polygons with the wrong winding order.
bagnell adc73da
We aren't checking if some styles are defined.
f5d2cae
Fix typo
fd23df9
Merge pull request #5718 from oterral/patch-3
5282d5d
Fix typo
a0bb925
Merge pull request #5719 from oterral/patch-4
ec6db3d
Added disableDepthTestDistance to point style.
9ef4d23
Added origin and labelOrigin styles.
1205e03
Changed label origin in vector tiles to match label collection.
bba1ca7
Initial mesh implementation. Still testing.
bagnell a7509de
Merge branch '3d-tiles-vector' into vector-tiles
bagnell d31b32f
Merge branch 'vector-tiles' into vector-tile-mesh
bagnell 83cc174
Updates after testing.
bagnell ca14796
Add ability to view classification mesh wireframe.
bagnell 848eb25
Merge branch 'master' into vector-tiles
f1fffb6
Merge branch 'master' into vector-tiles
bagnell 6f8bc61
Declare member in constructor.
bagnell dd6e212
Initial alpha classification styling.
bagnell e58d0b1
Fix artifacts from picking.
bagnell 8805c9b
Inverted classification for multipass OIT (MRT unsupported).
bagnell 63ada00
Fix for when OIT unsupported.
bagnell 07a2557
Add doc and code comments.
bagnell 346ad3e
Update Sandcastle example.
bagnell 244c0cf
Draw classification style when classification is inverted.
bagnell a3c19c4
Always pick classifications regardless of alpha or show property.
bagnell 2442aec
Fix rendering when highlighting on pick and classification is inverted.
bagnell a379ee0
Clean up.
bagnell 03d1a23
Merge branch 'master' into vector-tiles
bagnell d209338
Merge branch 'vector-tiles' into invertable-style
bagnell b409f7b
Add vector tile support for boxes, cylinders, ellipsoids, and spheres.
bagnell 5d6bac9
Merge branch 'vector-tiles' into invertable-style
bagnell 5f2e46d
Use tile bounding volume (still need pick bounding volumes). Fix batc…
bagnell 553affe
Merge branch 'vector-tiles' into invertable-style
bagnell c1c54c3
Change invertClassificationAlpha to invertClassificationColor.
bagnell 54dd4f5
Merge branch 'master' into vector-tiles
bagnell 39f5672
Merge branch 'vector-tiles' into invertable-style
bagnell 815e648
Fixes after merge.
bagnell 0a96758
Merge remote-tracking branch 'origin/master' into vector-tiles
gberaudo a17690e
Merge pull request #5810 from gberaudo/vector-tiles-1.37
bagnell 5642430
Fix constants.
bagnell 2defc39
Merge branch 'vector-tiles' into invertable-style
bagnell b1b8894
Fix vector tiles pass and enable skip LODs by default.
bagnell 5257ff9
Turn on skip LOD optimization by default.
bagnell 899af16
Fix data structure for rebatching mesh indices. Check if rebatching i…
bagnell 69584f0
Merge branch 'vector-tiles' into invertable-style
bagnell 3ac6180
Fix feature batch id.
bagnell 7b3dfdc
Merge branch 'vector-tiles' into invertable-style
bagnell 6e8cb08
Initial commit for optimized classification inversion.
bagnell 1e6ab0c
fix polyline vector tiles
likangning93 1dad5f3
Merge pull request #5828 from likangning93/fixPolylines
bagnell 4bc35a5
Fix transcluent invert color.
bagnell df81a03
Fix highlighting when inverted, re-enable picking in Sandcastle example.
bagnell eb1adb7
Change stencil reference and mask to remove multiple stencil clears.
bagnell be04782
Clear buffers for each frustum to fix multifrustum artifact.
bagnell cb50ce4
Merge branch '3d-tiles-vector' into vector-tiles
bagnell 8563ced
Merge branch 'vector-tiles' into invertable-style
bagnell 14072c5
Only update invert buffers when enabled. Only use translucency when f…
bagnell 5648f31
Fix blinking on pick.
bagnell 411b8fd
Fix for when alpha is unsupported and individual color components are…
bagnell 855ccd4
Add code comment for how the invert classification works.
bagnell 6478a76
Add invert classification support to ClassificationPrimitive. Update …
bagnell 40d5e4b
Add support to GroundPrimitive and add tests.
bagnell 099abba
Merge branch '3d-tiles-vector' into vector-tiles
bagnell b5c0565
Merge branch 'vector-tiles' into invertable-style
bagnell e16d16c
Clean up after merge.
bagnell 94fa13d
Merge pull request #5755 from AnalyticalGraphicsInc/invertable-style
bagnell 0ada825
Move classification mesh creation to a web worker.
bagnell 27670f5
Merge branch 'vector-tiles' into mesh-web-worker
bagnell bcdf661
Compute mesh bounding volumes.
bagnell 403aa24
Remove outdated Sandcastle example.
bagnell a9529ee
Remove outdated tests.
bagnell 81337ba
Add AttributeCompression and OrientedBoundingBox tests.
bagnell f11e6b6
Add new style tests.
bagnell 852df0b
Move geometry mesh creation to a web worker. Some renames. Add 3D Til…
bagnell 09128f9
Clean up geometry web worker.
bagnell 4887528
Compute Geometry bounding volumes.
bagnell 6f75de5
Clean up.
bagnell bed73b9
Move polyline loading to web worker.
bagnell 3b05f98
Clean up.
bagnell 7bef19c
Merged master.
688e705
Greatly improve performance for applying simple styles to vector tiles.
bagnell 8ef1b97
Merge branch '3d-tiles-vector' into vector-tiles
bagnell 603184a
Improve point load time and fix stuttering on load by moving position…
bagnell 312150a
Some clean up and more tests.
bagnell b79093f
Merge tag '1.38' into vector-tiles
gberaudo 2905c24
Merge pull request #5875 from gberaudo/merge-1.38-into-vector-tiles
bagnell 5602c30
Merge branch '3d-tiles-vector' into vector-tiles
bagnell 3a1f7bf
Add more vector tile geometry tests.
bagnell 7570c4c
Add vector tile mesh tests.
bagnell 6168e8a
Add wireframe tests.
bagnell 0c1a85d
Add geometry and mesh picking tests.
bagnell 76b177a
Add re-batch and invert classification tests.
bagnell a07d28c
Fix failing geometry tests on travis.
bagnell ed55b55
Fix failing meshe tests from travis.
bagnell 9504afb
Add polygon tests.
bagnell ceca0f6
Add test for polygons with different minimum and maximum heights.
bagnell 38cc1ae
Add vector tiles points tests.
bagnell d3726c3
Merge branch 'buffer-copy' into vector-tiles
bagnell 6379416
Merge branch '3d-tiles-vector' into vector-tiles
bagnell 69fbd0d
Add WebGL 2 tests for re-batches using buffer-to-buffer copies.
bagnell cfa3e0e
Add polyline tests.
bagnell 46439ef
Add sample tilesets.
bagnell 0060e18
Add vector content render and pick tests.
bagnell 68e52d5
Clean up batch ids creation.
bagnell 5f3e665
Add tests when the tile includes batch ids.
bagnell 4a168a9
Fix batch ids for cylinders, ellipsoids, and spheres.
bagnell 13df9bb
Update sample tilesets.
bagnell 7c1bfb8
Fix rebatching and indexing with batch ids.
bagnell d83392d
Do not apply model matrix to polygons when given in cartographic format.
bagnell cc89f78
Update samples and add debug colorize test.
bagnell 003ae7a
Fix re-batching after batch id changes.
bagnell 26a3883
Remove all of the indexOf calls to make re-batching faster.
bagnell d873b70
Add tests for a tile with all of the vector types combined.
bagnell 2319410
Change errors to RuntimeErrors for invalid tiles.
bagnell 360da0a
Update private doc.
bagnell 98a1cdc
Add option to classify either 3D Tiles, terrain or both.
bagnell adbc8ac
Add test for different classification types.
bagnell ff38aff
Update Sandcastle example.
bagnell 3c3df68
Merge branch '3d-tiles-vector' into vector-tiles
bagnell fd8bd82
Merge branch '3d-tiles-vector' into vector-tiles
bagnell 3f8b9fc
Merge branch '3d-tiles-vector' into vector-tiles
bagnell 3393c18
Merge tag '1.39' into vector-tiles
gberaudo 89a8ef4
Merge pull request #5960 from gberaudo/vector-tiles
bagnell acd3f81
Merge branch 'master' into vector-tiles
lilleyse 501c683
Merge branch '3d-tiles-vector' into vector-tiles
bagnell a76ae75
Merge branch '3d-tiles-vector' into vector-tiles
bagnell ce68124
Updates from review.
bagnell 0f80e6c
More updates from review.
bagnell 8b61e48
Add debug color option to point vector features.
bagnell 5877cef
Minor doc update.
bagnell 982aed9
Add better Sandcastle examples.
bagnell 0de3ec4
Update vector tiles links and add a comment about experimental nature.
bagnell 599fda2
Updates from review.
bagnell 8f31344
More updates from review. Fix eslint errors. Revert Point Cloud example.
bagnell 155c7ea
Update CHANGES.md. Minor updates from review.
bagnell d78d3d5
Merge branch '3d-tiles-vector' into vector-tiles
bagnell fdae6d3
Fix merge error.
bagnell f433975
Merge branch 'master' into vector-tiles
bagnell d17b3ba
Merge branch '3d-tiles-vector' into vector-tiles
bagnell 73d26af
Add experimental tags.
bagnell 27972ff
Add option to make a b3dm tileset classify another tileset.
bagnell b4f367a
Add a separate pass for classification on both terrain and 3D Tiles. …
bagnell e7ec3be
Optimize b3dm classification fragment shader.
bagnell 2b0f52f
Initial rework.
bagnell f1ab457
Remove unneeded code.
bagnell 33ff56e
Only create classification commands. Only create basic vertex and fra…
bagnell 7fe3e37
Only use position and batch id attributes.
bagnell b3993b5
Remove more unneeded code.
bagnell cc7a228
Remove shader parsing.
bagnell fad8860
Remove unused uniform semantics.
bagnell a2a1e2f
Mostly working. Needs clean up. There are issues with model matrices,…
bagnell 0d2f1e1
Fix model matrix.
bagnell 6981a68
Fix rebatching and remove derived commands.
bagnell e1218d7
Clean up.
bagnell 9173555
Fix test.
bagnell c1ad375
Revert Sandcastle example.
bagnell b448116
Remove mesh support from vector tiles.
bagnell f15d07f
Add Geometry tile.
bagnell 1f8fb07
Remove geometry from vector tile.
bagnell 9c054da
Update point cloud classification example. Tweak geometry tile to pre…
bagnell db85153
Update Vector tile specs.
bagnell 124d290
Add Geometry3DTileContent tests.
bagnell 1fe9fc8
Remove height reference.
bagnell 8eabdad
Remove more unneeded code.
bagnell 67cdf82
Fix failing test.
bagnell 15b58e4
Remove unused cache.
bagnell 0cefab9
Remove more unneeded code.
bagnell 3e88765
Fix broken test again.
bagnell bc232cd
Clamp volumes to the far plane.
bagnell 764267a
Add Sandcastle example.
bagnell 00f1792
Updates from review.
bagnell 7cec63d
Merge branch '3d-tiles-vector' into vector-tiles
bagnell 3ffd232
Merge branch 'vector-tiles' into b3dm-class
bagnell d377603
Update CHANGES.md after merge.
bagnell eb07e44
Update Sandcastle tileset url.
bagnell ea49b72
Remove node hierarchy.
bagnell 12283c4
Update doc.
bagnell 79ed093
Add tests. Fix quantization extension. Remove some more unneeded code.
bagnell 0ab3156
Merge branch 'b3dm-class' into vector-split
bagnell 5fdf1ad
Fix after merge.
bagnell 772a9c3
Updates from review.
bagnell 9fbc848
Merge branch 'b3dm-class' into vector-split
bagnell 612c5f5
Update CHANGES.md.
bagnell 618a892
Merge pull request #6034 from AnalyticalGraphicsInc/vector-split
pjcozzi d566de4
Remove some code expecting multiple primitives. Move glTF checks to c…
bagnell 045e458
Only create one primitive.
bagnell 6e57010
Don't parse shaders since they are generated.
bagnell 15380ef
Remove runtimeNode.
bagnell 92709e8
Create only one uniform map.
bagnell 36b2b53
Factor out common code.
bagnell a4c4506
Factor out gltf semantic uniforms.
bagnell 5232f88
Remove unused requires.
bagnell 029abad
Pass debug settings to the vector primitive.
bagnell 1fa1976
Add ClassificationModel tests.
bagnell 8f389cb
Update restrictions in the doc.
bagnell 53ed7f2
Merge branch '3d-tiles-vector' into vector-tiles
bagnell 5f4ed4c
Merge branch 'vector-tiles' into b3dm-class
bagnell 2385d20
Update function name.
bagnell 7d27a23
Merge pull request #6033 from AnalyticalGraphicsInc/b3dm-class
pjcozzi 6188233
Updates from review. Add arraySlice tests. Fix lower level classifica…
bagnell d42f320
More updates from review.
bagnell b407913
Rename pointColor -> color.
bagnell 459639a
Add tests for uncovered code.
bagnell bf9572d
Add exception tests for vector and geometry tiles.
bagnell 0f5b30e
Merge branch '3d-tiles-vector' into vector-tiles
bagnell 5587f89
Update horizontalOrigin, verticalOrigin, labelHorizontalOrigin, and l…
bagnell 695a60d
Add positive infinity constant for styling.
bagnell 09a8fd2
Align with revisions to spec. Update parsing and test tiles.
bagnell fe81890
Make skipLevelOfDetail a hint. Disable when using vector/geometry til…
bagnell 8350f31
Merge branch '3d-tiles-vector' into vector-tiles
bagnell 3340438
Update CHANGES.md.
bagnell b40c2a9
Update test tilesets to be uncompressed.
bagnell c379c63
Revert commits to Sandcastle example.
bagnell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
90 changes: 90 additions & 0 deletions
90
Apps/Sandcastle/gallery/3D Tiles Photogrammetry Classification.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> <!-- Use Chrome Frame in IE --> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> | ||
<meta name="description" content="Sample photogrammetry and classification datasets both rendered with 3D Tiles."> | ||
<meta name="cesium-sandcastle-labels" content="Showcases, 3D Tiles"> | ||
<title>Cesium Demo</title> | ||
<script type="text/javascript" src="../Sandcastle-header.js"></script> | ||
<script type="text/javascript" src="../../../ThirdParty/requirejs-2.1.20/require.js"></script> | ||
<script type="text/javascript"> | ||
require.config({ | ||
baseUrl : '../../../Source', | ||
waitSeconds : 60 | ||
}); | ||
</script> | ||
</head> | ||
<body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html"> | ||
<style> | ||
@import url(../templates/bucket.css); | ||
</style> | ||
<div id="cesiumContainer" class="fullSize"></div> | ||
<div id="loadingOverlay"><h1>Loading...</h1></div> | ||
<div id="toolbar"></div> | ||
<script id="cesium_sandcastle_script"> | ||
function startup(Cesium) { | ||
'use strict'; | ||
//Sandcastle_Begin | ||
// An example of using a b3dm tilset to classify another b3dm tileset. | ||
var viewer = new Cesium.Viewer('cesiumContainer'); | ||
|
||
// A normal b3dm tileset of photogrammetry | ||
var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ | ||
url : 'https://beta.cesium.com/api/assets/1458?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIxYmJiNTAxOC1lOTg5LTQzN2EtODg1OC0zMWJjM2IxNGNlYmMiLCJpZCI6NDQsImFzc2V0cyI6WzE0NThdLCJpYXQiOjE0OTkyNjM4MjB9.1WKijRa-ILkmG6utrhDWX6rDgasjD7dZv-G5ZyCmkKg' | ||
})); | ||
|
||
// Move the camera to view the tileset on load. | ||
tileset.readyPromise.then(function() { | ||
var boundingSphere = tileset.boundingSphere; | ||
viewer.camera.viewBoundingSphere(boundingSphere, new Cesium.HeadingPitchRange(0.0, -0.5, boundingSphere.radius)); | ||
viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY); | ||
}).otherwise(function(error) { | ||
throw(error); | ||
}); | ||
|
||
// A b3dm tileset used to classify the photogrammetry tileset | ||
var classification = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ | ||
url: 'https://beta.cesium.com/api/assets/3486?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIzZjM4MjljZi0xNTAzLTQ0MzctODhlZi0zOTU3Njg5ODA1Y2QiLCJpZCI6OCwiaWF0IjoxNDgxODI5ODMyfQ.dYlV8_PoXcFNlPHGook5kMzuJMS-Bb9DCMzI1mFVvgE', | ||
classificationType : Cesium.ClassificationType.CESIUM_3D_TILE | ||
})); | ||
|
||
classification.readyPromise.then(function() { | ||
classification.style = new Cesium.Cesium3DTileStyle({ | ||
color : 'rgba(255, 0, 0, 0.5)' | ||
}); | ||
}).otherwise(function(error) { | ||
throw(error); | ||
}); | ||
|
||
// The same b3dm tileset used for classification, but rendered normally for comparison. | ||
var nonClassification = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ | ||
url: 'https://beta.cesium.com/api/assets/3486?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIzZjM4MjljZi0xNTAzLTQ0MzctODhlZi0zOTU3Njg5ODA1Y2QiLCJpZCI6OCwiaWF0IjoxNDgxODI5ODMyfQ.dYlV8_PoXcFNlPHGook5kMzuJMS-Bb9DCMzI1mFVvgE', | ||
show : false | ||
})); | ||
nonClassification.readyPromise.then(function() { | ||
nonClassification.style = new Cesium.Cesium3DTileStyle({ | ||
color : 'rgba(255, 0, 0, 0.5)' | ||
}); | ||
}).otherwise(function(error) { | ||
throw(error); | ||
}); | ||
|
||
Cesium.when.join(classification.readyPromise, nonClassification.readyPromise).then(function() { | ||
Sandcastle.addToggleButton('Show classification', true, function(checked) { | ||
classification.show = checked; | ||
nonClassification.show = !checked; | ||
}); | ||
}); | ||
//Sandcastle_End | ||
Sandcastle.finishedLoading(); | ||
} | ||
if (typeof Cesium !== "undefined") { | ||
startup(Cesium); | ||
} else if (typeof require === "function") { | ||
require(["Cesium"], startup); | ||
} | ||
</script> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 103 additions & 0 deletions
103
Apps/Sandcastle/gallery/3D Tiles Point Cloud Classification.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> <!-- Use Chrome Frame in IE --> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> | ||
<meta name="description" content="A sample Vector dataset on terrain rendered with 3D Tiles."> | ||
<meta name="cesium-sandcastle-labels" content="Showcases, 3D Tiles"> | ||
<title>Cesium Demo</title> | ||
<script type="text/javascript" src="../Sandcastle-header.js"></script> | ||
<script type="text/javascript" src="../../../ThirdParty/requirejs-2.1.20/require.js"></script> | ||
<script type="text/javascript"> | ||
require.config({ | ||
baseUrl : '../../../Source', | ||
waitSeconds : 60 | ||
}); | ||
</script> | ||
</head> | ||
<body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html"> | ||
<style> | ||
@import url(../templates/bucket.css); | ||
</style> | ||
<div id="cesiumContainer" class="fullSize"></div> | ||
<div id="loadingOverlay"><h1>Loading...</h1></div> | ||
<script id="cesium_sandcastle_script"> | ||
function startup(Cesium) { | ||
'use strict'; | ||
//Sandcastle_Begin | ||
// An example showing a point cloud tileset classified by a Geometry tileset. | ||
var viewer = new Cesium.Viewer('cesiumContainer'); | ||
|
||
//Point Cloud by Prof. Peter Allen, Columbia University Robotics Lab. Scanning by Alejandro Troccoli and Matei Ciocarlie. | ||
viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ | ||
url : 'https://beta.cesium.com/api/assets/1460?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIyMzk2YzJiOS1jZGFmLTRlZmYtYmQ4MS00NTA3NjEwMzViZTkiLCJpZCI6NDQsImFzc2V0cyI6WzE0NjBdLCJpYXQiOjE0OTkyNjQ3NTV9.oWjvN52CRQ-dk3xtvD4e8ZnOHZhoWSpJLlw115mbQJM' | ||
})); | ||
|
||
// Geometry Tiles are experimental and the format is subject to change in the future. | ||
// For more details, see: | ||
// https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/vector-tiles/TileFormats/Geometry | ||
var classification = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ | ||
url: 'https://beta.cesium.com/api/assets/3469?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIzZjM4MjljZi0xNTAzLTQ0MzctODhlZi0zOTU3Njg5ODA1Y2QiLCJpZCI6OCwiaWF0IjoxNDgxODI5ODMyfQ.dYlV8_PoXcFNlPHGook5kMzuJMS-Bb9DCMzI1mFVvgE', | ||
classificationType : Cesium.ClassificationType.CESIUM_3D_TILE | ||
})); | ||
classification.readyPromise.then(function() { | ||
classification.style = new Cesium.Cesium3DTileStyle({ | ||
color : { | ||
conditions : [ | ||
["${id} === 'roof1'", "color('#004FFF', 0.5)"], | ||
["${id} === 'towerBottom1'", "color('#33BB66', 0.5)"], | ||
["${id} === 'towerTop1'", "color('#0099AA', 0.5)"], | ||
["${id} === 'roof2'", "color('#004FFF', 0.5)"], | ||
["${id} === 'tower3'", "color('#FF8833', 0.5)"], | ||
["${id} === 'tower4'", "color('#FFAA22', 0.5)"], | ||
["true", "color('#FFFF00', 0.5)"] | ||
] | ||
} | ||
}); | ||
}); | ||
|
||
viewer.scene.camera.setView({ | ||
destination : new Cesium.Cartesian3(4401448.974612145, 225038.45962842644, 4595135.776680152), | ||
orientation : { | ||
heading : 5.36861655457269, | ||
pitch : -0.4029289137364358 | ||
} | ||
}); | ||
|
||
// Information about the currently highlighted feature | ||
var highlighted = { | ||
feature: undefined, | ||
originalColor: new Cesium.Color() | ||
}; | ||
|
||
// Color a feature yellow on hover. | ||
viewer.screenSpaceEventHandler.setInputAction(function onMouseMove(movement) { | ||
// If a feature was previously highlighted, undo the highlight | ||
if (Cesium.defined(highlighted.feature)) { | ||
highlighted.feature.color = highlighted.originalColor; | ||
highlighted.feature = undefined; | ||
} | ||
|
||
// Pick a new feature | ||
var pickedFeature = viewer.scene.pick(movement.endPosition); | ||
if (!Cesium.defined(pickedFeature)) { | ||
return; | ||
} | ||
|
||
// Highlight the feature | ||
highlighted.feature = pickedFeature; | ||
Cesium.Color.clone(pickedFeature.color, highlighted.originalColor); | ||
pickedFeature.color = Cesium.Color.YELLOW.withAlpha(0.5); | ||
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE); | ||
//Sandcastle_End | ||
Sandcastle.finishedLoading(); | ||
} | ||
if (typeof Cesium !== "undefined") { | ||
startup(Cesium); | ||
} else if (typeof require === "function") { | ||
require(["Cesium"], startup); | ||
} | ||
</script> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
94 changes: 94 additions & 0 deletions
94
Apps/Sandcastle/gallery/3D Tiles Terrain Classification.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> <!-- Use Chrome Frame in IE --> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> | ||
<meta name="description" content="A sample Vector dataset on terrain rendered with 3D Tiles."> | ||
<meta name="cesium-sandcastle-labels" content="Showcases, 3D Tiles"> | ||
<title>Cesium Demo</title> | ||
<script type="text/javascript" src="../Sandcastle-header.js"></script> | ||
<script type="text/javascript" src="../../../ThirdParty/requirejs-2.1.20/require.js"></script> | ||
<script type="text/javascript"> | ||
require.config({ | ||
baseUrl : '../../../Source', | ||
waitSeconds : 60 | ||
}); | ||
</script> | ||
</head> | ||
<body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html"> | ||
<style> | ||
@import url(../templates/bucket.css); | ||
</style> | ||
<div id="cesiumContainer" class="fullSize"></div> | ||
<div id="loadingOverlay"><h1>Loading...</h1></div> | ||
<script id="cesium_sandcastle_script"> | ||
function startup(Cesium) { | ||
'use strict'; | ||
//Sandcastle_Begin | ||
var viewer = new Cesium.Viewer('cesiumContainer'); | ||
|
||
viewer.terrainProvider = new Cesium.CesiumTerrainProvider({ | ||
url : 'https://assets.agi.com/stk-terrain/v1/tilesets/world/tiles', | ||
requestWaterMask : true, | ||
requestVertexNormals : true | ||
}); | ||
|
||
var geocoder = viewer.geocoder.viewModel; | ||
geocoder.searchText = 'Vienna'; | ||
geocoder.flightDuration = 0.0; | ||
geocoder.search(); | ||
|
||
|
||
// Vector 3D Tiles are experimental and the format is subject to change in the future. | ||
// For more details, see: | ||
// https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/vector-tiles/TileFormats/VectorData | ||
var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ | ||
url: 'https://beta.cesium.com/api/assets/3584?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIzZjM4MjljZi0xNTAzLTQ0MzctODhlZi0zOTU3Njg5ODA1Y2QiLCJpZCI6OCwiaWF0IjoxNDgxODI5ODMyfQ.dYlV8_PoXcFNlPHGook5kMzuJMS-Bb9DCMzI1mFVvgE', | ||
classificationType : Cesium.ClassificationType.TERRAIN | ||
})); | ||
|
||
tileset.readyPromise.then(function() { | ||
tileset.style = new Cesium.Cesium3DTileStyle({ | ||
color : 'rgba(255, 255, 255, 0.5)' | ||
}); | ||
}).otherwise(function(error) { | ||
throw(error); | ||
}); | ||
|
||
// Information about the currently highlighted feature | ||
var highlighted = { | ||
feature: undefined, | ||
originalColor: new Cesium.Color() | ||
}; | ||
|
||
// Color a feature yellow on hover. | ||
viewer.screenSpaceEventHandler.setInputAction(function onMouseMove(movement) { | ||
// If a feature was previously highlighted, undo the highlight | ||
if (Cesium.defined(highlighted.feature)) { | ||
highlighted.feature.color = highlighted.originalColor; | ||
highlighted.feature = undefined; | ||
} | ||
|
||
// Pick a new feature | ||
var pickedFeature = viewer.scene.pick(movement.endPosition); | ||
if (!Cesium.defined(pickedFeature)) { | ||
return; | ||
} | ||
|
||
// Highlight the feature | ||
highlighted.feature = pickedFeature; | ||
Cesium.Color.clone(pickedFeature.color, highlighted.originalColor); | ||
pickedFeature.color = Cesium.Color.YELLOW; | ||
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE); | ||
//Sandcastle_End | ||
Sandcastle.finishedLoading(); | ||
} | ||
if (typeof Cesium !== "undefined") { | ||
startup(Cesium); | ||
} else if (typeof require === "function") { | ||
require(["Cesium"], startup); | ||
} | ||
</script> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will there be any Sandcastle examples using vector tiles in the more traditional sense - labels, billboards, polylines, etc? Also it's not completely clear which of the new demos are using b3dm vs. geom vs. vctr for classification. Each should have a comment about what tile format they are using.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a comment to each example.
The
3D Tiles Terrain Classification
example is traditional vector tiles (polygons draped on terrain). There are no polylines or points/billboards/labels. This is the best I can do until I find better open data and better tiling.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opened an issue to keep track of this: #6095