Closed bkuster closed 5 years ago
I will look at this solution for release 2.7.0.
@bkuster thank you for revealing this issue and proposing a solution. This solution seems correct.
you can avoid a multiplication because transform
is already multiplying in matrixWorld
if (volume.region) {
const box = tmpBox3.copy(volume.region.box3D)
.applyMatrix4(volume.region.matrixWorld);
return Extent.fromBox3(crs, box);
}
Could you open the PR?
sure thing!
When determining the extent of a b3dm, the
volume
is analyzed. This can be one of three:region
,box
orsphere
. Bothbox
andsphere
are handled correctly, butregion
is still treated as the original user input and not the derived internal data type, which is an oriented bbox _in the parents frame of reference created here.Code producing the issue: https://github.com/iTowns/itowns/blob/87bb03e55836311f20142f811e9788ce90971120/src/Process/3dTilesProcessing.js#L38-L44
Possible fix
I tried hacking in the following. Since I'm new to working with both iTowns and THREE, there most likely is a better solution, but this works:
If you care for a PR with this solution, I'm more then happy to open one up.