how to do positioning in 3D Tiles Location Editor

922 views
Skip to first unread message

Kathy

unread,
Jun 14, 2019, 9:24:38 AM6/14/19
to cesium-dev
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.
Cesium 1.57, Windows, Firefox / chrome.
3d tiles location editor.png

Omar Shehata

unread,
Jun 14, 2019, 12:15:49 PM6/14/19
to cesium-dev
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:

viewer.scene.globe.depthTestAgainstTerrain = 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!

Kathy

unread,
Jun 17, 2019, 4:06:56 AM6/17/19
to cesium-dev
Hi Omar,

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?

Kind regards,

Kathy
3D Tiles Location Editor_01.jpg
3D Tiles Location Editor_02.jpg
3D Tiles Location Editor_03.jpg
3D Tiles Location Editor_04.jpg

Omar Shehata

unread,
Jun 20, 2019, 5:47:56 PM6/20/19
to cesium-dev
Hi Kathy,

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.

Omar Shehata

unread,
Jun 26, 2019, 10:11:21 AM6/26/19
to cesium-dev
Yes that's it, thanks for sharing the link! It does look like setting:

viewer.scene.globe.depthTestAgainstTerrain = false;

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:

Kathy

unread,
Jun 27, 2019, 4:29:06 AM6/27/19
to cesium-dev
Thanks again, Omar!

I modified the code in sandcastle as you suggested and integrated the Height toolbar into it, can see the whole roadmap now.(https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/index.html#c=rVVtb+I4EP4rVu8DQYIAS1+2bLc6SlfdoALXlm63iC+O4wQXx87ZDi2c+t93nJeStKuTTrpIiMx4Zp7Hz4ydTgddKSwMGlHN0nh8hzAhVGtkJNrKVCEmBcJaU6OXIo9xPSncgIY45WaYBc/lmgr0FTXodrzyrwibsbF3v/N6U+ZpT9wekZF37K2Tnz9G41MXgv4OrtYQ5B1NHu67i4cxW7Du4WM8jq/nt3z2cGMen9a7Kes9LebD3jS+2U0vx3wx99j1aJwsoNhkPtxNntZQfPrk9y842XrHDwBO+lmMeNyOAxv7+POGzZ6+9abzx5fZJdlOLvmpOwtPvhv/+pTf440XbLA0Xfzg8017EQ3V8W4UhlF0EkVHJyde48tSLMUGK7Rh9Jkq2KSgz4VY7o/M5zRIZo6kMJgJqhot9M9SIHgMVQpcfym5YQFkD6rZ+d+8HuIUmfZJFR+gvea3VENDCHVDJeOhbYkXOL1mHv8K/69NYJvzdDWhgroRlz6FXiVmNafaDCNA0qaAhL2EmGta2+JEBpTDSkFjRVm0MgPUhepZXEFnLSRZy9S4RmGydt4ym2/FjJTcx1awQJI0psK4ETXfOLWvF1ug3ihCGjbpfV2cJHx7wUTARKT39Vtl3QoQ4xS0AKDa1hPFYmbYhmoXB4GTb+eD+v3LeZ7+X3Xvd4+O+xXtCz45g52U8Vw6BbMiypVmRdUz09QJU0GMPVgOdEKqJqqAEym05NTlMipWv5Qov20AiDrzNVUb7HNaFaqR967RdHXqa6KYvwd28rVmvc0g4TSNfRjCYrlAZiFymJ7iaemvEVbUpEqUJC1F+2I7Q7AyMlI4WTECtUvhK95MUuuAJSxKwVxfplnj7xJQjLrQTzhIJRtbWacqxITWi2Y1+lnJWxzAu3aqDEBRETGTBrSF6n5sCnfX7VZRZBjmg/W/gtS1zSYYLmBtA6T4LRj0zx4z4+SEWuX2W7V5fot3mmXxUs/YTsQEG8Ve9gC5fZhtZb5n4FTY2DowdgetgzNttpye52X/ZHEilbHnxHHdjqFxAvFUd/yUrAGOaF0y+KO8BioD48ONESnb4gFSkY+dw08tVP667ucy1z4JnF0YhAE6TF4qbl8quCvbCjqQ6uri6ztYJpLUVME3VBlGMG9jziIxQDELAk4/IraNTAboUw21XPKlMTKurgLsWaeU6CxgG8SCr8uDd9+F5QEiHL6lsBKmnN+xHV0enJ91IL6WxiW2ODPgyvHWhqx659e503Xdsw6YH7OKLUN4zsmunH/Phq0Mzty5JGabUEiCXkdAAmQQYLV7XTgC1sQvYJaWNjSxJrwG2OC2D9cy2BvMUzoo5rmFMvM+gQhwNjKUxp5MDdXQF2PrggBgHf1b3axCyf8X)
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.

Best Regards,
Kathy

Kathy

unread,
Jun 27, 2019, 4:47:34 AM6/27/19
to cesium-dev
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!

Kind regards,
Kathy
3D Tiles Location Editor_05.png
Height toolbar.png

Omar Shehata

unread,
Jun 28, 2019, 4:16:15 PM6/28/19
to cesium-dev
Glad that helped Kathy!

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.

kangle...@gmail.com

unread,
Jul 2, 2019, 4:14:24 AM7/2/19
to cesium-dev
Hi Omar,

thanks a lot for your explanation, it's clear now.

Kind Regards,
Kathy

在 2019年6月28日星期五 UTC+2下午10:16:15,Omar Shehata写道:
Reply all
Reply to author
Forward
0 new messages