Hi I am new to this library, and I think the New York City 3d tiles demo is pretty cool.
I downloaded the New York data source from https://cesiumjs.org/NewYork/3DTiles/NewYork.zip
And I added to “3d-tiles-samples-master\tilesets” and started it run on “http://localhost:8003/” and in my cesium 3d HTML file I tried to do something like:
<!DOCTYPE html>
<html lang=“en”>
<head>
<!-- Use correct character set. -->
<meta charset=“utf-8”>
<!-- Tell IE to use the latest, best version. -->
<meta http-equiv=“X-UA-Compatible” content=“IE=edge”>
<!-- Make the application on mobile take up the full browser screen and disable user scaling. -->
<meta name=“viewport” content=“width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no”>
<title>Hello World!</title>
<script src="../Build/Cesium/Cesium.js"></script>
<style> @import url(../Build/Cesium/Widgets/widgets.css);
html, body, #cesiumContainer {
width: 100%; height: 100%; margin: 0; padding: 0; overflow: hidden;
}
</style>
</head>
<body>
<div id=“cesiumContainer”></div>
<script>
var viewer = new Cesium.Viewer(‘cesiumContainer’);
var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
url : ‘http://localhost:8003/tilesets/NewYork/’
}));
Thanks for your suggestion Rachel!
I did run "npm run minifyRelease" to build for HelloWorld. I think the issue might be the New York city 3d tiles data source. It seems the tilesets.json file is encoded as I downloaded from https://cesiumjs.org/NewYork/3DTiles/NewYork.zip.
I know the data is converted from CityGML data from http://www1.nyc.gov/site/doitt/initiatives/3d-building.page. Do you know how to convert the CityGML to the data source I can use in Cesium 3d tiles?
Thanks Sean! I have the "zoom" code. I think it is the data source issue. I guess after this PR is merged. I don't have extract the New York City .zip data file. I can include it directly. As for now, after I extract the data file, the tilesets.json is encoded. I think this is the issue.
You cannot just simply replace the tileset.json file. You need to include the whole data folder. Make sure you update to the latest 3d-tiles branch, and then check the syntax here https://github.com/AnalyticalGraphicsInc/3d-tiles-samples
I would like to experiment on my local machine as well but it seems the NYC 3d tiles are no longer available. Does anybody have any info on this> Thanks!
Thanks Gabby for the download link. My main goal to have those files is to understand the tileset.json file, and the difference between the properties used to style the features and the properties that can be accessed using the Viewer.scene.pick function.
It seems that those “properties” are two different things. Can anyone point me to how to 1) get both the properties, and 2) add those properties in to the 3D Tiles?
Also, though the file from Gabby’s link does have them all, for some reasons I cannot read the files (they are all a bunch of strange characters, no matter I tried ANSI or UFT-8 encoding). Is there anything I can do to better understand them?
Pardon me for sounding like I’m ranting. I really like Cesium and am very impressed with what it does. But I’m having a hard time understanding how to add interactivity to it and use the 3D Tiles properly.
The properties that are used to style and that are accessed by a picked Cesium3DTileFeature object are the same. They are bundled in the b3dm files within the batch table section. Additionally Cesium3DTileFeature.setProperty can let you add properties at runtime.
As for the tileset itself, all the files are gzipped. You can use 3d-tiles-tools ungzip to get the original view of the data. I’ll also see if we can replace that download link with the ungzipped version, as well as include it in the workshop.
Thanks for the feedback, these are all reasonable points.
Thanks Sean for your answers! I’ve updated the files at that link I provided above. They are now the uncompressed files and should be readable for your purposes.
The Cesium Workshop tutorial was aimed at providing a high level overview of the Cesium API rather than an exploration of the 3D Tiles format or the New York dataset itself. I think you are fair in pointing out our learning materials could indeed use information on the topic of 3D Tiles and interactivity. I will create an issue to create for materials that are more targeted to developers interested in learning the same.
Thanks for your understanding and the explanations. I’ve been trying to understand both the tileset.json file and those .b3dm files being referred to. In particular I’m looking at how properties can be inserted when we generate the 3D Tiles using FME 2017, and how we can later retrieve them in Cesium (an example of such property is a search key). The Cesium3DTileFeature.setProperty doesn’t seem to be what I need for this purpose because I’m not adding anything dynamic (which will be lost when the tiles are unloaded).
I hit a strange roadblock when following those files though. My main source of information are these 2 GitHub readme’s:
The first one contains information on how tileset.json is defined and what its content means. And one of the objects there is called “properties”, which describes the per-feature properties in the tileset. The strange thing, however, is that the tileset.json of the New York files does NOT have this property. Instead this property is only present in the .d3dm files (aka Batch Table according to the second readme) as part of the JSON Header (as you described in your previous post). So are the properties in the .json file just for indicating the min and max?
I agree that the Cesium Workshop is a high level overview and it does quite a good job to help people get started. I however feel that 3D Tiles is one of Cesium’s stronger features (pun intended), and it’d be great if there are more in-depth discussion on how to generate and incorporate them in to Cesium. I know that I’m still new to it, but if there is any way I can contribute to the creation of the materials that you mentioned targeting developers interested in learning the same, let me know.
Yes, the properties section in tileset.json is just for the min and max values of the b3dm properties.
A quick overview of how batch ids work is each vertex in the glTF (embedded in the b3dm) contains a batchId attribute associated with it. This value is anywhere between 0 and BATCH_LENGTH - 1, and determines which feature a vertex belongs to (there are BATCH_LENGTH number of features). This value is used to index into the property arrays in the batch table. This presentation goes into a little more detail: https://cesium.com/presentations/#3d-tiles-streaming-massive-heterogeneous-3d (slides 114-117 in particular). Note that some of the diagrams may be out-of-date, but the concepts are still the same.
Our goal is for the spec to be a good starting point for developers to dive into 3D Tiles. It might not be the best for beginners, but it’s where our energy is going at the moment. Maybe in the future we can devote more time to beginner resources.
know that I’m still new to it, but if there is any way I can contribute to the creation of the materials that you mentioned targeting developers interested in learning the same, let me know.
Contributions would be greatly appreciated! When you feel like you’ve learned enough to start writing learning resources, reach out to Sarah at schow@agi.com. She could help you in publishing tutorials or blog posts on the subject. Thanks!