No announcement yet.

Dragging Polygons Causes Them to be Distorted even when Returned to Original Position

  • Filter
  • Time
  • Show
Clear All
new posts

  • Dragging Polygons Causes Them to be Distorted even when Returned to Original Position

    I'm running into a Worldwind issue where dragging a SurfacePolygon around the globe and then moving it back to its original position causes it to be distorted from how it originally was at that position. My understanding is that when the polygon is moved back to its original position, it should look the same. I found a similar post about this that mentioned a small calculation error could be compounding over the course of the drag causing the distortion. You can best see this problem by dragging polygons in a circular clockwise motion which will shrink the polygon. This is easily testable using the DraggableShapes example. So far I've only seen this issue with Polygons and Boxes. Circles appear to work as intended.

    Some areas of note that I've looked at are:
    1) -> getReferencePosition() - this returns the first point in the outer boundary (I feel like this should instead return the calculated center point of the polygon?)
    2) -> doMoveTo(Globe globe, Position oldReferencePosition, Position newReferencePosition) - this method is what is called as the shape is dragged.
    3) -> computeShiftedLocations(Globe globe, LatLon oldLocation, LatLon newLocation, Iterable<? extends LatLon> locations) - this method computes the transformation of the boundary points.

    I'm running off a slightly older version of the Worldwind code but when I looked at the latest code I didn't see any relevant changes that would fix this problem. I need these transformations to work for both the Globe & FlatEarth. Any assistance on the following would be very helpful:
    1) Has this bug been encountered/reproduced/fixed?
    2) Math resources on Transforming Polygons on a Globe.
    3) Any other code areas of interest.

    Thanks in advance!