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

Does glTF2.0 support the CESIUM_RTC extension? #1159

Closed
caohaoze opened this issue Nov 20, 2017 · 10 comments
Closed

Does glTF2.0 support the CESIUM_RTC extension? #1159

caohaoze opened this issue Nov 20, 2017 · 10 comments

Comments

@caohaoze
Copy link

If glTF2.0 does not support the CESIUM_RTC, which one is the better way to transform the glTF in 3D Tiles?
1.add the transform matrix to the node's transform attribute in the tileset.json
2.add the transform matrix to the node's matrix attribute in the glTF.
3.other way....

@caohaoze
Copy link
Author

Does Cesium have any solutions or adjustments about loading 3D Tiles with glTF2.0?

@pjcozzi
Copy link
Member

pjcozzi commented Nov 20, 2017

@caohaoze yes, CESIUM_RTC supports glTF 2.0 - we should update the extension spec to make this clear since it was written against the glTF 1.0 spec.

Yes, Cesium's 3D Tiles loader supports glTF 2.0.

CC @lilleyse if he has anything to add.

@caohaoze
Copy link
Author

Now, I know that the Cesium_RTC is equivalent to add a translation matrix to the root node of glTF model which implement moving the model to the face of the earth. But I have another question: does these two methods have different efficiency when rendering glTF models in the browser?

@caohaoze
Copy link
Author

For example, I create a model with 3ds Max. Then I convert it to glTF. The x-axis of this glTF model points east. Y-axis points north. Z-axis points up. And the geo location of the origin of the coordinate system has been known.
Now I want to convert it to 3D Tiles through my own program. To move this model to right place in 3D Tiles, which one method is best way to set up the infomation?
1.add the transform matrix to the node's transform attribute in the tileset.json
2.add the transform matrix to the root node's matrix attribute in the glTF.
3.transform the glTF, then add infomation of Cesium_RTC to the extensions.

@pjcozzi
Copy link
Member

pjcozzi commented Dec 18, 2017

Ping @lilleyse.

@lilleyse
Copy link
Contributor

lilleyse commented Dec 22, 2017

@caohaoze all three methods should produce the same result, though I personally haven't tried method 2 with a 3D Tiles tileset.

Methods 1 and 2 are pretty safe because even though the model matrix and view matrix start to lose precision at Earth scale, all the math in JavaScript is double precision so the matrix multiply won't have much or any quality loss. CESIUM_RTC will be more exact, but the difference probably won't be noticeable.

We've created a lot of tilesets using method 1 without issues. Method 1 is also convenient if you need to edit the transform later like if you need to adjust the tileset's rotation or height.

@caohaoze
Copy link
Author

Does these two methods have difference in efficiency while rendering glTF models in the browser?
With Cesium_RTC
Without Cesium_RTC

@lilleyse
Copy link
Contributor

No difference in efficiency.

@caohaoze
Copy link
Author

Thank you very much.

@pjcozzi
Copy link
Member

pjcozzi commented Dec 22, 2017

Thanks @lilleyse @caohaoze!

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

No branches or pull requests

3 participants