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

scale geometric error with tileset #7411

Merged
merged 10 commits into from
Sep 19, 2019

Conversation

Vineg
Copy link
Contributor

@Vineg Vineg commented Dec 13, 2018

@cesium-concierge
Copy link

Thanks for the pull request @Vineg!

  • ✔️ Signed CLA found.
  • CHANGES.md was not updated.
    • If this change updates the public API in any way, please add a bullet point to CHANGES.md.

Reviewers, don't forget to make sure that:

  • Cesium Viewer works.
  • Works in 2D/CV.
  • Works (or fails gracefully) in IE11.

I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome.

🌍 🌎 🌏

@hpinkos
Copy link
Contributor

hpinkos commented Dec 13, 2018

Thanks @Vineg! @lilleyse will review this soon

@Vineg
Copy link
Contributor Author

Vineg commented Dec 28, 2018

@lilleyse this is ready for review

Source/Core/Matrix3.js Outdated Show resolved Hide resolved
@hpinkos
Copy link
Contributor

hpinkos commented Dec 28, 2018

Can you add some unit tests for the new matrix function?

@hpinkos
Copy link
Contributor

hpinkos commented Dec 28, 2018

Those are all my comments. @lilleyse will do the final review. Thanks @Vineg!

@Vineg
Copy link
Contributor Author

Vineg commented Dec 28, 2018

@hpinkos @lilleyse done

@cesium-concierge
Copy link

Thanks again for your contribution @Vineg!

No one has commented on this pull request in 30 days. Maintainers, can you review, merge or close to keep things tidy?

I'm going to re-bump this in 30 days. If you'd like me to stop, just comment with @cesium-concierge stop. If you want me to start again, just delete the comment.

@hpinkos
Copy link
Contributor

hpinkos commented Jan 28, 2019

@lilleyse can you review this?

@lilleyse
Copy link
Contributor

Yes, sorry for the delay. I plan to review this soon.

Copy link
Contributor

@lilleyse lilleyse left a comment

Choose a reason for hiding this comment

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

Thank @Vineg, just some small comments from me.

I opened CesiumGS/3d-tiles#367 to keep track of this change in the spec.

Source/Core/Matrix3.js Show resolved Hide resolved
Source/Core/Matrix3.js Outdated Show resolved Hide resolved
Source/Renderer/UniformState.js Show resolved Hide resolved
Source/Scene/Cesium3DTile.js Show resolved Hide resolved
Specs/Core/Matrix3Spec.js Show resolved Hide resolved
Specs/Core/Matrix3Spec.js Show resolved Hide resolved
@hpinkos
Copy link
Contributor

hpinkos commented Feb 21, 2019

@Vineg @geoscan-builder bump =) let us know when these comments are addressed and this is ready for another look. Thanks!

@Vineg
Copy link
Contributor Author

Vineg commented Feb 21, 2019

Yeah, I hope to get back to this soon

@cesium-concierge
Copy link

Thanks again for your contribution @Vineg!

No one has commented on this pull request in 30 days. Maintainers, can you review, merge or close to keep things tidy?

I'm going to re-bump this in 30 days. If you'd like me to stop, just comment with @cesium-concierge stop. If you want me to start again, just delete the comment.

1 similar comment
@cesium-concierge
Copy link

Thanks again for your contribution @Vineg!

No one has commented on this pull request in 30 days. Maintainers, can you review, merge or close to keep things tidy?

I'm going to re-bump this in 30 days. If you'd like me to stop, just comment with @cesium-concierge stop. If you want me to start again, just delete the comment.

@Vineg
Copy link
Contributor Author

Vineg commented Apr 23, 2019

@cesium-concierge stop

@Vineg
Copy link
Contributor Author

Vineg commented May 13, 2019

@lilleyse applied proposed changes and moved getRotation to getMatrix3 as discussed in #7398

@hpinkos
Copy link
Contributor

hpinkos commented Sep 18, 2019

@lilleyse what's the status of this PR?

@lilleyse
Copy link
Contributor

@hpinkos Waiting on my review which I'll finish up now.

Copy link
Contributor

@lilleyse lilleyse left a comment

Choose a reason for hiding this comment

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

Thansk @Vineg, this is really close.

Matrix4.getRotation = function(matrix, result) {
return Matrix4.getMatrix3(matrix, result);
};

/**
* Gets the upper left 3x3 rotation matrix of the provided matrix, assuming the matrix is a affine transformation matrix.
Copy link
Contributor

Choose a reason for hiding this comment

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

Unrelated typo I noticed.

Suggested change
* Gets the upper left 3x3 rotation matrix of the provided matrix, assuming the matrix is a affine transformation matrix.
* Gets the upper left 3x3 rotation matrix of the provided matrix, assuming the matrix is an affine transformation matrix.

*
* @param {Matrix3} matrix The matrix.
* @param {Matrix3} result The object onto which to store the result.
* @returns {Cartesian3} The modified result parameter
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* @returns {Cartesian3} The modified result parameter
* @returns {Matrix3} The modified result parameter

/**
* @deprecated moved to Matrix4.getMatrix3
*/
Matrix4.getRotation = function(matrix, result) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It's fine to keep the original description and then insert the @deprecated line. Also add a deprecationWarning to the function.

    /**
     * Gets the upper left 3x3 rotation matrix of the provided matrix, assuming the matrix is a affine transformation matrix.
     *
     * @param {Matrix4} matrix The matrix to use.
     * @param {Matrix3} result The object onto which to store the result.
     * @returns {Matrix3} The modified result parameter.
     *
     * @deprecated This function has been deprecated. Use {@link Matrix4#getMatrix3} instead.
     *
     * @example
     * // returns a Matrix3 instance from a Matrix4 instance
     *
     * // m = [10.0, 14.0, 18.0, 22.0]
     * //     [11.0, 15.0, 19.0, 23.0]
     * //     [12.0, 16.0, 20.0, 24.0]
     * //     [13.0, 17.0, 21.0, 25.0]
     *
     * var b = new Cesium.Matrix3();
     * Cesium.Matrix4.getRotation(m,b);
     *
     * // b = [10.0, 14.0, 18.0]
     * //     [11.0, 15.0, 19.0]
     * //     [12.0, 16.0, 20.0]
     */
    Matrix4.getRotation = function(matrix, result) {
        deprecationWarning('Matrix4.getRotation', 'Matrix4.getRotation is deprecated and will be removed in Cesium 1.65. Use Matrix4.getMatrix3 instead.');
        return Matrix4.getMatrix3(matrix, result);
    };

Copy link
Contributor

Choose a reason for hiding this comment

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

Add the deprecation notice to CHANGES.md:

##### Deprecated :hourglass_flowing_sand:
* The function `Matrix4.getRotation` has been deprecated and renamed to `Matrix4.getMatrix3`. `Matrix4.getRotation` will be removed in version 1.65. [#7411](https://github.com/AnalyticalGraphicsInc/cesium/pull/7411)

Copy link
Contributor

Choose a reason for hiding this comment

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

There are still a lot of occurrences of Matrix4.getRotation in the code that should be changed to Matrix4.getMatrix3 (one in Frustum.html, the rest in specs).

var scale = new Cartesian3();
var expectedScale = new Cartesian3(1.0, 1.0, 1.0);
result = Matrix3.getRotation(matrix, result);
console.log(result);
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove console.log(result)

expect(function() {
return Matrix3.getRotation();
}).toThrowDeveloperError();
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Also add a separate check for getRotation throws without a result

@lilleyse
Copy link
Contributor

lilleyse commented Sep 18, 2019

Note to self after merging: this PR fixes both #5330 and #7398

And update the spec: CesiumGS/3d-tiles#367

@hpinkos hpinkos changed the base branch from master to scale-geometric-error September 19, 2019 14:14
@hpinkos
Copy link
Contributor

hpinkos commented Sep 19, 2019

I'm going to merge this into a branch and take over the rest of the clean up. Thanks for all the work you did for this @Vineg!

@hpinkos hpinkos merged commit 2ea3899 into CesiumGS:scale-geometric-error Sep 19, 2019
@lilleyse lilleyse mentioned this pull request Mar 4, 2020
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.

5 participants