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

3D Tiles Transform Tests #4256

Merged
merged 4 commits into from Sep 1, 2016
Merged

3D Tiles Transform Tests #4256

merged 4 commits into from Sep 1, 2016

Conversation

lilleyse
Copy link
Contributor

@lilleyse lilleyse commented Aug 30, 2016

Tests for #4130

Sorry about the branch confusion. This is merging into pnts-updates instead of 3d-tiles-transform mainly because of all the file renaming that happened in #4228.

I reworked ModelInstanceCollection extensively to simplify it and fix some bugs related to its interaction with shadows and derived commands. The functionality is the same though.

// Transform from y-up to z-up
Matrix3.multiply(yUpToZUpMatrix3, halfAxes, halfAxes);
Matrix4.multiplyByPoint(yUpToZUpMatrix4, center, center);
}
Copy link
Contributor Author

@lilleyse lilleyse Aug 30, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The spec now defines local bounding volumes as y-up. So I do the y-up to z-up conversion at runtime. I was also wondering about transforms in local space...

Say you have a root and a child. The root has a transform that goes from local to wgs84 and the child has a transform that translates it upward by 10 meters. Intuitively the child's transform should be a translation of (0.0, 10.0, 0.0) to match the y-up convention of local-space. However the translation needed by Cesium is (0.0, 0.0, 10.0). So the transforms are z-up and bounding volumes are y-up.

The main issue is how do we make the distinction that a transform/bounding volume is in local space vs wgs84 space? Should all transforms be y-up including the wgs84 transform? Or should we instead define z-up as the convention?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be consistent with glTF, y should be up.

To be consistent with WGS84 (and local east-north-up), z should be up.

If I understand you correctly, to be consistent with local vs WGS84 coordinates, z should be up.

It would be nice to be consistent with glTF, but it sounds like we have a compelling reason to go with z up. Do you agree?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah you summed it up well. I agree that z-up is better for this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's do it. Please update the spec as well - including the main spec as well as b3dm and i3dm specs where glTF is explicitly mentioned.

@pjcozzi
Copy link
Contributor

pjcozzi commented Aug 30, 2016

Any typed array memory concerns with ModelInstanceCollection? No because everything is converted to a separate data structure?

@pjcozzi
Copy link
Contributor

pjcozzi commented Aug 30, 2016

Other than these comments, code and tests look good. Did you run coverage?

@lilleyse
Copy link
Contributor Author

Any typed array memory concerns with ModelInstanceCollection? No because everything is converted to a separate data structure?

Yeah that's correct.

Did you run coverage?

Yeah coverage is mostly solid.

I'm curious what you think about the inline comments.

@lilleyse
Copy link
Contributor Author

Updated. I squashed some commits because of the change to z-up and EAST_NORTH_UP.

@@ -45,6 +46,7 @@ define([
getExtensionFromUri,
Intersect,
joinUrls,
CesiumMath,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is used.

@pjcozzi
Copy link
Contributor

pjcozzi commented Aug 31, 2016

Code looks OK.

I'm curious what you think about the inline comments.

What comments?

@lilleyse
Copy link
Contributor Author

What comments?

The ones you already looked at before.

@lilleyse
Copy link
Contributor Author

lilleyse commented Sep 1, 2016

Thanks @lasalvavida for the updated tiles. @pjcozzi this is ready to merge now.

@pjcozzi
Copy link
Contributor

pjcozzi commented Sep 1, 2016

Tests and Sandcastle example are good!

@pjcozzi pjcozzi merged commit a162752 into pnts-updates Sep 1, 2016
@pjcozzi pjcozzi deleted the transform-tests branch September 1, 2016 16:13
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

Successfully merging this pull request may close these issues.

None yet

2 participants