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

Question about intersectsBox and crs transform. #15

Open
skywalkershen opened this issue Sep 4, 2019 · 1 comment
Open

Question about intersectsBox and crs transform. #15

skywalkershen opened this issue Sep 4, 2019 · 1 comment

Comments

@skywalkershen
Copy link

Hi, I'm new to 3d tiles and trying to use this lib to display my cesium asset tiles, and found during the checkLoad, there is no boundingvolume intersets with the camera frustum. Below are my understanding toward this issue and how this lib works, and I wish you can help me to clarify some of the doubts and point a direction. Thank you so much.

To my understanding, this is how 3d tile works: The vertex info in b3dm/pnts are merely forming meshes in a non-georeferenced Cartesian coordinate system. It is the boundingvolume that defines its geo location and bounding. And the bounding volume can be in any crs or even non georeferenced(in 3d scene Cartesian coordinate system). The transform is applied to project children's crs to the parent's crs, or from root crs to base map crs(in this case, web mercator EPSG:3857 for mapbox).

So I assume the problem with my case lies in the crs. The cesium ion assets are not in EPSG3857(There is no crs info in the tileset.json, I assume it is in EPSG: 4979 since it is recommended in the 3d tile standard), and the transform provided is not from 4979 to 3857.

So there can be two approaches:

  1. Transform the boundingvolume into 3857 to make it consistent with mapbox crs, and remove the transform info(or use default identity matrix).
  2. Leave the boundingvolume as it is, and change the transform info to the transform needed from the boundingvolume's crs to 3857.

I've tried gdal and epsg.io to transform 4979 to 3857, but failed. And I don't really have a clue about how to form the transform matrix needed from 4979 to 3857.

Could you please help to clarify the doubt and shed some light upon this issue?
Thank you.

@bertt
Copy link
Member

bertt commented Sep 4, 2019

Hi, Cesium uses EPSG:4978 not 4979.

You can follow tutorial on https://github.com/Geodan/pg2b3dm/blob/master/getting_started.md to see how it all works.

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