Skip to content
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

Instanced 3D Tiles - Getting attributes #810

Open
AnthonyGlt opened this issue Oct 16, 2024 · 1 comment
Open

Instanced 3D Tiles - Getting attributes #810

AnthonyGlt opened this issue Oct 16, 2024 · 1 comment
Labels
question Further information is requested

Comments

@AnthonyGlt
Copy link
Contributor

Original issue :
iTowns/itowns#2434

Hi, I want to show attributes of Instanced 3D Tiles (I3dm), like it works with Batched 3D Tiles (b3dm)

Sample (does not work): Click on cube in https://www.itowns-project.org/itowns/examples/3dtiles_loader.html?tileset=https://bertt.github.io/cesium_3dtiles_samples/samples/instanced/traffic_lights/tileset.json

Cesium Sample shows attributes Id, Bevestiging on click on cube : https://bertt.github.io/cesium_3dtiles_samples/samples/instanced/traffic_lights/

image

I've tried to get the attributes from an i3dm dataset. By looking at the b3dm example, I've also tried to access the batchid from the selected geometry but it's missing.

Should I use an other attribute for this purpose ? Or should we add ourselves an id in the i3dmLoader for each instance ?

To Reproduce
I've used b3dm example
Replacing new B3DMLoader() by the I3DMLoader
I've tried by using a subpart of the tileset from the original issue:
https://bertt.github.io/cesium_3dtiles_samples/samples/instanced/traffic_lights/tiles/0_1_9_0.i3dm

Thank you

@AnthonyGlt AnthonyGlt added the question Further information is requested label Oct 16, 2024
@gkjohnson
Copy link
Contributor

gkjohnson commented Oct 16, 2024

Instances can't have per-vertex ids the way B3DM files do. For instances you can compute the instance id based on the instance number or by reading the BATCH_ID field from the BatchTable at the same index. From the BatchTable docs:

The length of each array is equal to batchLength, which is specified in each tile format. This is the number of features in the tile. For example, batchLength may be the number of models in a b3dm tile, the number of instances in a i3dm tile, or the number of points (or number of objects) in a pnts tile.

And from the i3dm spec section on batch table semantics: BATCH_ID can be present but is not required. So you have to resolve that id differently for instances.

If you have ideas on how to make this more ergonomic I'm open to suggestions. Otherwise this can be done in any target application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants