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

PolylineGeometry IDL split #2242

Merged
merged 14 commits into from
Nov 5, 2014
Merged

PolylineGeometry IDL split #2242

merged 14 commits into from
Nov 5, 2014

Conversation

bagnell
Copy link
Contributor

@bagnell bagnell commented Nov 1, 2014

For #1197.

PolylinePipeline.wrapLongitude and GeometryPipeline.wrapLongitude were both being called when creating and batching PolylineGeometry. So in 2D, the line would be split by the IDL and then the triangles would be tested for intersection. In 3D, the line would still be split by the IDL in the first function and the second function would not be called.

This removes the PolylinePipeline.wrapLongitude call and adds a special case to GeometryPipeline.wrapLongitude for PolylineGeometrys. A special case is needed because the polyline triangles are degenerate (to lines) that are expanded in the vertex shader.

// and intersects the xz-plane
var intersection = IntersectionTests.lineSegmentPlane(p0, p1, xzPlane);
if (defined(intersection)) {
// move point on the xz-plane slightly away from the plane
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this needed? Because of noise in the cartographic conversion function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. If we set the y component to zero, we sometimes get lines that draw over the whole map to the other side of the IDL.

@pjcozzi
Copy link
Contributor

pjcozzi commented Nov 3, 2014

Update README.md

@pjcozzi
Copy link
Contributor

pjcozzi commented Nov 3, 2014

Does this need new unit tests?

@bagnell
Copy link
Contributor Author

bagnell commented Nov 4, 2014

@pjcozzi This is ready for another look.

@pjcozzi
Copy link
Contributor

pjcozzi commented Nov 5, 2014

Update this test.

var newIndices = [];

var length = newPositions.length / 3;
for (var i = 0; i < length; i += 4) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't we do a quick check of the bounding volume before entering this loop?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We check the bounding sphere in wrapLongitude before the code for splitting triangles, lines or polylines.

Copy link
Contributor

Choose a reason for hiding this comment

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

Gotcha.

@bagnell
Copy link
Contributor Author

bagnell commented Nov 5, 2014

@pjcozzi This is ready.

pjcozzi added a commit that referenced this pull request Nov 5, 2014
@pjcozzi pjcozzi merged commit 5778c9a into master Nov 5, 2014
@pjcozzi pjcozzi deleted the wrapLongitude branch November 5, 2014 17:31
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.

2 participants