-
Notifications
You must be signed in to change notification settings - Fork 473
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
Bounding Volume coordinate system clarification #280
Comments
Hey @amenzies, thanks for the diagrams and notes - this will be really helpful once we bring the spec to completion. I think everything you've stated is correct. I may not get to the spec edits right away so I'll leave this open until then.
I wonder how it can be described clearly in the spec that we are going with option (B). The gltf spec uses the words
Yup that's correct. The spec text could be clearer about the order of operations.
I find this confusing too and I wish the coordinate systems of 3D Tiles and glTF matched. We put some thought into making 3D Tiles y-up but it doesn't translate well to most globe engines (including Cesium) that use z-up coordinate systems such as WGS84. Meanwhile glTF has historically been y-up and so we decided to honor that convention. My recommendation is to export glTF models using the same z-up coordinate system as 3D Tiles and then setting |
@amenzies |
@amenzies @caohaoze @mlfarrell-convene - would you mind checking out the latest changes to the coordinate system wording? I think we addressed all the points you guys brought up but would like any feedback you have. The PR is #307. Specifically check out: Coordinate Reference System. A couple changes since then:
If you have any thoughts, feel free to leave them here or in the linked PR. |
Still me, I used wrong account before. I wasn't using asset.gltfUpAxis, but the CESIUM_RTC stuff I WAS using quite heavily. That's definitely going to trip up my work. Any chance to keep that around? I'm using the FME 2018 export output, so if they switch over to feature table, I'll have to find a way to support that too. |
Cesium will have backwards compatible support for |
Okay. Well that works. Thanks! |
Resolved in #301 |
@lilleyse, little late getting back to you. This looks great to me. I find the new wording a lot clearer and appreciate the order of operations example. Thanks! |
Great! Thanks for the feedback. |
Stuck at this again trying for a tile reader. Is there any other source of information besides the spec? Somebody has an example maybe? Or can point me to where cesium does it? So i apply the node transforms in gltf and then rotate to y up and it should work? My tile set doesnt specify a matrix . |
@3a1b2c3 the order of transformations is:
So the glTF needs to be y-up for this to work Some other resources that might be helpful:
|
Ok great thats exactly what am doing to get my meshes into WGS84 now. Very helpful function createBoundingBoxFromGltf( // Take into account the y-up-to-z-up transform: |
Hi,
I'm working on a 3D Tiles exporter and renderer. I'm trying to understand the relationship between the
3D Tiles coordinate frame
and theglTF coordinate frame
, especially in relation to bounding volumes and the gltfUpAxis property.As an example, lets say we have a box stored in a glTF file with Y as the up axis. Our goal is to create a tileset containing this box. In our tileset, we need to store the bounding volume for the box. My understanding is that the bounding volume needs to be stored in
3D Tiles Frame
(z-up) NOT inglTF frame
(y-up). So in this case, in our exporter we first compute the glTF files bounds inglTF frame
and then apply aglTF to 3D Tiles
transform to get it into3D Tiles frame
. In the renderer, we then need to apply the opposite of this transform when we read the glTF file to convert it into3D Tiles frame
at runtime.I've made the following diagram to illustrate the process of going from
![image](https://user-images.githubusercontent.com/6226387/35303363-8fc234d0-0046-11e8-9a7d-f8fb7d363abe.png)
glTF Frame
to3d Tiles Frame
as I understand it.In the diagram, I assume we want to render the box n the given orientation regardless of how we define the coordinate frame. However, there are many configurations for a right handed coordinate system in which Z is up. I've created two examples (A) and (B). Depending on which of these we choose, our
glTF to 3D Tiles
transform will be different. This presents a problem because the tileset generator and renderer need to use the same convention. Based on this changeset, it looks like cesium uses (B) but I don't see this documented in the specification anywhere.I haven't fully worked this out, but it seems like things would only get more confusing once the options for gltfUpAxis get added to the mix.
Please let me know if I've misunderstood how this works.
I think it would be very useful to add some additional text to the README about these transformations and when they should be applied (both during tileset creation and rendering). I'm assuming this should be applied right after loading the glTF file before applying the Tile.transform property.
Overall, I've found it pretty confusing that
3D Tiles
uses a different frame then the underlying content storage mechanism. It almost feels like each tile or the tileset could specify acontent to tileset
matrix to be used when converting the content into tileset frame.Thanks for the help!
Cheers,
-Alex
The text was updated successfully, but these errors were encountered: