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

Clipping planes invert distance sign #6073

Merged
merged 1 commit into from
Jan 1, 2018
Merged

Clipping planes invert distance sign #6073

merged 1 commit into from
Jan 1, 2018

Conversation

ggetz
Copy link
Contributor

@ggetz ggetz commented Dec 29, 2017

Adjust Plane.transform function and adjusted distance sign accordingly.

@ggetz ggetz requested a review from hpinkos December 29, 2017 15:09
@cesium-concierge
Copy link

Signed CLA is on file.

@ggetz, thanks for the pull request! Maintainers, we have a signed CLA from @ggetz, so you can review this at any time.

⚠️ I noticed that CHANGES.md has not been updated. If this change updates the public API in any way, fixes a bug, or makes any non-trivial update, please add a bullet point to CHANGES.md and comment on this pull request so we know it was updated. For more info, see the Pull Request Guidelines.


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

🌍 🌎 🌏

@pjcozzi
Copy link
Contributor

pjcozzi commented Dec 29, 2017

@lilleyse just a reminder that this is a not a breaking change; transform was added this release.

@hpinkos
Copy link
Contributor

hpinkos commented Dec 29, 2017

@ggetz this all looks fine to me. Are we sure we have it right this time? Is there an equation we followed to write the Plane.transform function? I just don't want to merge this without understanding why we had to make this change.

@ggetz
Copy link
Contributor Author

ggetz commented Dec 29, 2017

I was using the definition of plane.distance opposite of what was previously defined:

The shortest distance from the origin to the plane. The sign of distance determines which side of the plane the origin is on. If distance is positive, the origin is in the half-space in the direction of the normal; if negative, the origin is in the half-space opposite to the normal; if zero, the plane passes through the origin.

So when computing the position representing the location of the plane, we need to multiply the normal by the opposite of the distance, rather than the distance as is.

@hpinkos
Copy link
Contributor

hpinkos commented Dec 29, 2017

Great, sounds good @ggetz!

I think this is good to go, but I'll leave it open until the 2nd so @lilleyse can take a quick look at it and merge before the release

@lilleyse
Copy link
Contributor

lilleyse commented Jan 1, 2018

So when computing the position representing the location of the plane, we need to multiply the normal by the opposite of the distance, rather than the distance as is.

Alright, that does make sense.

I tested out the demos and ran the tests. This change looks good to me.

@lilleyse lilleyse merged commit 1602bb2 into master Jan 1, 2018
@lilleyse lilleyse deleted the plane-distance branch January 1, 2018 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants