-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Conversation
…nging the triangle split code to catch that case.
// 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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Update README.md |
Does this need new unit tests? |
…s the IDL. Custom geometries will still be split based on the primitive type.
@pjcozzi This is ready for another look. |
Update this test. |
var newIndices = []; | ||
|
||
var length = newPositions.length / 3; | ||
for (var i = 0; i < length; i += 4) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha.
@pjcozzi This is ready. |
For #1197.
PolylinePipeline.wrapLongitude
andGeometryPipeline.wrapLongitude
were both being called when creating and batchingPolylineGeometry
. 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 toGeometryPipeline.wrapLongitude
forPolylineGeometry
s. A special case is needed because the polyline triangles are degenerate (to lines) that are expanded in the vertex shader.