How to change position of feature of 3dtiles?

I find official sandcastle give a example to change position of 3dtiles:

But there seems to be no examples or any APIs of changing a specific feature in 3dtiles.

I also find @sean_lilley’s answer in 2017:

I wonder is there any other ways for now?

@Gu-Miao

Thank you for bringing us your question! What specific features are you looking to change?

-Sam

For example, I could use viewer.screenSpaceEventHandler.setInputAction() to set a left click handler, and in handler, I could use viewer.scene.pick() to get a feature.

1 Like

From my understanding, a feature of a tileset isn’t a standalone thing you can manipulate in different ways, those features are linked to the chain of tiles and mostly is about metadata (like properties) from the tileset. Or do you mean a tile? (Tiles probably can be fiddled with, but you’d have to look at the API for that, I think it’s mostly unsupported)

But maybe explain the problem you’re trying to solve first? If you have lots of smaller tiled models you want to style or move or otherwise manipulate, I’d render them as their own tileset and add them one by one.

But maybe explain the overall problem you’re trying to solve? What is it that you’re trying to do?

Cheers,

1 Like

Hello Alexander, Thanks for reply.

I have 3dtiles data of a lot of buildings, every building is a feature. what I want is moving a building when I click it.

As you said, I didn’t find any API to manipulate a single feature. Maybe I should modify my data like divide what can move into one part and what can’t move into another? I think it could work. But I’m worried about too much 3dtiles loading would affect performance too much. Maybe there’s a better way?

Best

Hiya,

Yeah, the only thing left to explore is that every tile has a local transform, so you could try to manipulate the transform (essentially a 4D matrix) either by tinkering with the matrix directly, or by creating a new one with different values in the transform. I don’t know if the API will do anything at that point (don’t know if they do change detection on the transform, and apply if it does), but worth a shot. It might be worth a shot digging into the Cesium code itself to find that out, could solve your problem.

Otherwise, yes, I think you need might need to have moveable parts in their own tileset. Odd question, perhaps, but why do you want to move the building when clicked? Is it a simple view on/off, or something else?

Cheers,

Alex

Soon I’m going to get a data of detailed building model that contains a part of inner structure(This part will be a feature). And when I click the building, I should move that part to show it. But right now I only have a data of buildings, so I used that as an example.

But for now, I’m going to tell my data maker to split the data into several parts to load.

No worries. I’d still look into the transform on the tile, as well as just toggle the visibility on and off (although didn’t check the API for this).

Cheers,

Alex