Skip to content

Commit

Permalink
Merge pull request #8955 from CesiumGS/wall-order
Browse files Browse the repository at this point in the history
Draw walls with positions in order given
  • Loading branch information
mramato authored Jun 15, 2020
2 parents e59a8a9 + 3dc59e8 commit f35b743
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

### 1.71 - 2020-07-01

##### Breaking Changes :mega:

- Updated `WallGeometry` to respect the order of positions passed in, instead of making the positions respect a counter clockwise winding order. This will only effect the look of walls with an image material. If this changed the way your wall is drawing, reverse the order of the positions.

##### Fixes :wrench:

- Fixed error with `WallGeoemtry` when there were adjacent positions with very close values [#8952](https://github.com/CesiumGS/cesium/pull/8952)
Expand Down
21 changes: 0 additions & 21 deletions Source/Core/WallGeometryLibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ import arrayRemoveDuplicates from "./arrayRemoveDuplicates.js";
import Cartesian3 from "./Cartesian3.js";
import Cartographic from "./Cartographic.js";
import defined from "./defined.js";
import EllipsoidTangentPlane from "./EllipsoidTangentPlane.js";
import CesiumMath from "./Math.js";
import PolygonPipeline from "./PolygonPipeline.js";
import PolylinePipeline from "./PolylinePipeline.js";
import WindingOrder from "./WindingOrder.js";

/**
* @private
Expand Down Expand Up @@ -132,24 +129,6 @@ WallGeometryLibrary.computePositions = function (
maximumHeights = o.topHeights;
minimumHeights = o.bottomHeights;

if (wallPositions.length >= 3) {
// Order positions counter-clockwise
var tangentPlane = EllipsoidTangentPlane.fromPoints(
wallPositions,
ellipsoid
);
var positions2D = tangentPlane.projectPointsOntoPlane(wallPositions);

if (
PolygonPipeline.computeWindingOrder2D(positions2D) ===
WindingOrder.CLOCKWISE
) {
wallPositions.reverse();
maximumHeights.reverse();
minimumHeights.reverse();
}
}

var length = wallPositions.length;
var numCorners = length - 2;
var topPositions;
Expand Down

0 comments on commit f35b743

Please sign in to comment.