1. A concise explanation of the problem you’re experiencing.
I would like to tile a 3d road network model in cesium. The roads are OBJ file generated by Roadrunner. I have done the converting in Cesium ion, but have problem with using 3D Tiles Location Editor. The default camera view for user is unknown, even if I adjust the head/pitch/roll to tile it into the position from this view, if I change to another view, the position looks not correct tiled again. And for the “Search/longitude/latitude/Height” items, there is a default value of Height more than 400, if I change it to for example 100, the roads will be invisible. So how to do exactly positioning of 3d tile sets? I know this is a great tool, and I would like to know how to use it in a proper way. Any help would be appreciated. Many thanks!
2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
load 3d roads model into Cesium.
4. The Cesium version you’re using, your operating system and browser.
Hi Kathy, can you elaborate a bit more on this sentence:
if I change to another view, the position looks not correct tiled again.
Are you saying when you move the camera inside the location editor, that the 3D Tileset itself moves?
For positioning the height, I usually place the 3D Tileset just high enough so it’s not sinking in the terrain. If you do need to be at a height lower than the ground but still be visible, you can do this in your CesiumJS app or in Sandcastle by setting depth test to false:
We’re definitely open to feedback here, so even if you end up discovering a way to do what you need, but it isn’t very straightforward or convenient, please let me know!
thanks again for your reply!
Maybe it’s because the height is not correctly set, so when the view changes, the position looks changed also.
When I was in 3D Tiles location Editor, the defalut view is like picture 1. So I changed the view using scroll to look downside, so as to align the position of roads, as in picture 2. When I changed the height from the default value to 350, part of the roads became invisible, as in picture 3. I also tried to set the Heading to 0, Pitch to 0 and Roll to -90, which I thought it would make the object flatly tiled on the map, as in picture 4, part of the roads also became invisible. This region is a part of old region in a city, and it seems having no high building. For positioning the height, actually I just want the road tile set to be above the ground, not to below the ground. My Asset id is 30563. Could you please guide me to get it right?
I think I see what you mean. Can you share the Sandcastle link for the asset? (This should be the link you get when you look at the asset in the preview window on cesium.com/ion, in the right side of the screen). My hunch is that you might want to set viewer.scene.globe.depthTestAgainstTerrain = false in your Cesium app after positioning it in the right height, such that the parts that are underground still show through and aren’t occluded by the terrain.
Make the occluded parts appear, without having to move the tileset up. The other tip I have is I usually integrate the slider from the example below in my application to double check that it has the right height even after doing that setting:
Another doubt is, Can I also do some position adjusting in App.js code to make the position precisely proper? Because now from 3D Tiles Location Editor I’m not sure it’s exactly right positioned or not.
Sorry I forgot one thing to mention, after I added the Height toolbar, when I run it in the sandcastle, it shows the Height 0, but when I back to the 3D location Editor, it was still 420. Does it matter? Thanks!
The reason the height toolbar always shows 0 is because it’s set to be relative to wherever the tileset is currently positioned. This is different from how the Cesium ion Location Editor works, which modifies the tileset transform directly (this is how ion lets you save the transform, while the widget in the Sandcastle code example doesn’t modify the tileset).
You can adjust the position in the app as well, in the same way that the height works. Notice that the offset in the code is applied just to the height, but you could apply it to the latitude, longitude, or use a Cartesian3 to apply x/y/z offset instead.