3DTilesRendererJS icon indicating copy to clipboard operation
3DTilesRendererJS copied to clipboard

3DTilesRenderer: Consider a utility function to center & orient tileset

Open skywalkershen opened this issue 1 year ago • 3 comments

Hi, I'm trying to use this library to load 3dtiles, yet I found it doesn't work for some tilesets. The oob.inFrustum always return false for some root tiles. I've made a jsfiddle listing some of the tilesets I've tested, hope you can help me with this issue. You can simply uncomment lines for tileset url to switch tileset.

Thank you

https://jsfiddle.net/skywalkershen/8k74vsf9/2/ image

skywalkershen avatar Aug 01 '23 09:08 skywalkershen

Hi, I noticed it should be caused by the root transform of the tileset. If a transform matrix is provided, it will be multiplied to the bbox, link: https://github.com/NASA-AMMOS/3DTilesRendererJS/blob/a25bb252e0bf316e673e8ca38574b7a58d7da841/src/three/math/TileBoundingVolume.js#L239-#L246

Is it possible to provide a param to control whether to use the root transform? like: https://github.com/ebeaufay/threedtiles/blob/05d741f53420bd7fc4d4a159f7f7398b4dd06313/src/tileset/OGC3DTile.js#L35 https://github.com/ebeaufay/threedtiles/blob/05d741f53420bd7fc4d4a159f7f7398b4dd06313/src/tileset/OGC3DTile.js#L219-#L223

Thank you.

skywalkershen avatar Aug 03 '23 08:08 skywalkershen

Do you have any suggestions on API?

This sounds similar to the setLatLonToYUp function. I'm wondering if something like a .recenter function would be good - or a .orientLatLonNormalUp function to handle cases where the a building tileset would be oriented strangely due to its lat / lon position.

gkjohnson avatar Aug 05 '23 05:08 gkjohnson

Haven't touched the function you mentioned. Currently I'm only considering use a boolean param to ignore the transform when calculating bbox. I'll look into the source code, and maybe come back with a pr.

skywalkershen avatar Aug 07 '23 06:08 skywalkershen