visgl / deck.gl

WebGL2 powered visualization framework
https://deck.gl
MIT License
12.19k stars 2.09k forks source link

modelMatrix not working in Tile3DLayer #7309

Open radoslavirha opened 2 years ago

radoslavirha commented 2 years ago

Description

Hi,

I need to move some 3D tiles (Tile3DLayer) to 0 elevation. Using custom modelMatrix does not work it seems.

I discussed it on slack, but it seems to be a bug in deck.gl, not my bad implementation.

Thanks!

Flavors

Expected Behavior

Accept custom modelMatrix

Steps to Reproduce

const modelMatrix = new Matrix4().scale([1, 1, 0]);

const ion = new Tile3DLayer({
  id: "tile-3d-layer",
  data: TILESET_URL,
  loader: CesiumIonLoader,
  // modelMatrix,
  loadOptions: {
    "cesium-ion": { accessToken: ION_TOKEN }
  },
  _subLayerProps: {
    pointcloud: {
      modelMatrix
    }
  }
});

https://codesandbox.io/s/deck-gl-3d-tiles-forked-t2crt6?file=/src/App.js:1239-1607

Environment

Logs

nothing

radoslavirha commented 1 year ago

Hi, can anybody confirm it's a bug? Thanks

Pessimistress commented 1 year ago

modelMatrix does not work in Tile3DLayer because Tileset3D does not support it. We should include this limitation in the documentation. You can open a feature request in loaders.gl.

r2dev commented 1 week ago

checking with the latest doc in loaders.js, modelMatrix has been added for Tileset3D. Add modelMatrix as part of loaderOptions doesnt seem to be working <Tile3DLayer data="/tileset.json" loaderOptions={{ '3d-tiles': { modelMatrix, }, }} />

is this the correct way to add modelMatrix to Tile3Dlayer?

"@deck.gl/core": "9.0.29" "@loaders.gl/core": "4.2.3"