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

tiles: transform is not applied on boundingVolume of type 'region' #1994

Open
Avnerus opened this issue Dec 7, 2021 · 4 comments
Open

tiles: transform is not applied on boundingVolume of type 'region' #1994

Avnerus opened this issue Dec 7, 2021 · 4 comments

Comments

@Avnerus
Copy link
Collaborator

Avnerus commented Dec 7, 2021

Hi!
I was trying out a 3D Tiles point cloud prepared using Entwine. It used a boundingVolume of type 'region'. I noticed that I am unable to transform the tileset (for example bring it to 0,0,0) due to the transform not being applied here.
I did find an old version where it seems that transforms are applied also in the 'region' scenario.
Is there any reason for this?
Thank you!
(cc: @dryabinin-actionengine , @ibgreen)

@belom88
Copy link
Collaborator

belom88 commented Dec 8, 2021

https://github.com/CesiumGS/3d-tiles/tree/main/specification#transforms

..., except when tile.boundingVolume.region is defined

@Avnerus
Copy link
Collaborator Author

Avnerus commented Dec 8, 2021

Thanks @belom88! OK that specifies that a tile does not intrinsically contain a transform matrix when its boundingVolume is 'region'. However, my interest is in manipulating the boundingVolume from the outside, using the modelMatrix property (so I can move the tileset to 0,0,0, not being forced to fly the camera to the geo-coordinates). Shouldn't there be a way to do it? Or is there another way?
It is because of this line that modelMatrix eventually trickles down to all of the tiles' transform. I tested this and adding the transform to the boundingSphere allowed me to move the tileset. It didn't allow me to rotate it though, because it's a sphere...

@belom88
Copy link
Collaborator

belom88 commented Feb 7, 2022

@Avnerus can I close this issue?

@Avnerus
Copy link
Collaborator Author

Avnerus commented Feb 7, 2022

Hi, well I believe this is not resolved yet. I promised to submit a PR but didn't get around to it yet.
Just to document, we were planning to replicate this logic in CesiumJS:

  // A region bounding volume is not transformed by the transform in the tileset JSON,
  // but may be transformed by additional transforms applied in Cesium.
  // This is why the transform is calculated as the difference between the initial transform and the current transform.
  transform = Matrix4.multiplyTransformation(
    transform,
    Matrix4.inverseTransformation(initialTransform, scratchTransform),
    scratchTransform
  );

In loaders.gl, I think it would work if we multiplied the region by the transform argument, which is in effect computedTransform and then by the invert of initialTransform , negating any transform that may have existed (by mistake) in the json.

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

No branches or pull requests

2 participants