Skip to content

Commit

Permalink
Merge pull request #1099 from hpinkos/corridorOutline
Browse files Browse the repository at this point in the history
Corridor outline
  • Loading branch information
bagnell committed Sep 3, 2013
2 parents f63c4d0 + 81eda88 commit 6c86ae0
Show file tree
Hide file tree
Showing 8 changed files with 995 additions and 325 deletions.
77 changes: 54 additions & 23 deletions Apps/Sandcastle/gallery/Geometry and Appearances.html
Original file line number Diff line number Diff line change
Expand Up @@ -778,50 +778,81 @@
})
}));

var corridor = new Cesium.CorridorGeometry({
positions : ellipsoid.cartographicArrayToCartesianArray([
Cesium.Cartographic.fromDegrees(-120.0, 45.0),
Cesium.Cartographic.fromDegrees(-125.0, 50.0),
Cesium.Cartographic.fromDegrees(-125.0, 55.0)
]),
width : 100000,
vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT
positions = ellipsoid.cartographicArrayToCartesianArray([
Cesium.Cartographic.fromDegrees(-120.0, 45.0),
Cesium.Cartographic.fromDegrees(-125.0, 50.0),
Cesium.Cartographic.fromDegrees(-125.0, 55.0)
]);
var width = 100000;

var corridor = new Cesium.GeometryInstance({
geometry: new Cesium.CorridorGeometry({
positions : positions,
width : width,
vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT
}),
attributes : {
color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromRandom({alpha : 1.0}))
}
});

var corridorInstance = new Cesium.GeometryInstance({
geometry: corridor,
var extrudedCorridor = new Cesium.GeometryInstance({
geometry: new Cesium.CorridorGeometry({
positions : positions,
width : width,
vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,
height: 300000,
extrudedHeight: 400000
}),
attributes : {
color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromRandom({alpha : 0.7}))
}
});

var extrudedCorridor = new Cesium.CorridorGeometry({
positions : ellipsoid.cartographicArrayToCartesianArray([
Cesium.Cartographic.fromDegrees(-120.0, 45.0),
Cesium.Cartographic.fromDegrees(-125.0, 50.0),
Cesium.Cartographic.fromDegrees(-125.0, 55.0)
]),
width : 100000,
vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,
height: 300000,
extrudedHeight: 400000
var corridorOutline = new Cesium.GeometryInstance({
geometry: new Cesium.CorridorOutlineGeometry( {
positions: positions,
width: width,
height: 700000
}),
attributes: {
color : solidWhite
}
});

var extrudedCorridorInstance = new Cesium.GeometryInstance({
geometry: extrudedCorridor,
var corridorFill = new Cesium.GeometryInstance({
geometry: new Cesium.CorridorGeometry({
positions : positions,
width : width,
vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,
height: 700000
}),
attributes : {
color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromRandom({alpha : 0.7}))
}
});

primitives.add(new Cesium.Primitive({
geometryInstances : [corridorInstance, extrudedCorridorInstance],
geometryInstances : [corridor, extrudedCorridor, corridorFill],
appearance : new Cesium.PerInstanceColorAppearance({
translucent : true,
closed : true,
faceForward : true
})
}));

primitives.add(new Cesium.Primitive({
geometryInstances : corridorOutline,
appearance : new Cesium.PerInstanceColorAppearance({
flat : true,
renderState : {
depthTest : {
enabled : true
},
lineWidth : Math.min(4.0, scene.getContext().getMaximumAliasedLineWidth())
}
})
}));

Sandcastle.finishedLoading();
});
Expand Down
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Change Log
Beta Releases
-------------

### b21 - 2013-10-01
* Added `CorridorOutlineGeometry`.

### b20 - 2013-09-03

_This releases fixes 2D and other issues with Chrome 29.0.1547.57 ([#1002](https://github.com/AnalyticalGraphicsInc/cesium/issues/1002) and [#1047](https://github.com/AnalyticalGraphicsInc/cesium/issues/1047))._
Expand Down
15 changes: 15 additions & 0 deletions Source/Core/CornerType.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,35 @@ define(['../Core/Enumeration'], function(Enumeration) {
*/
var CornerType = {
/**
* ___
* ( ___
* | |
*
* Corner is circular.
* @type {Enumeration}
* @constant
* @default 0
*/
ROUNDED : new Enumeration(0, 'ROUNDED'),

/**
* ______
* | ___
* | |
*
* Corner point is the intersection of adjacent edges.
* @type {Enumeration}
* @constant
* @default 1
*/
MITERED : new Enumeration(1, 'MITERED'),

/**
* ___
* / ___
* | |
*
* Corner is clipped.
* @type {Enumeration}
* @constant
* @default 2
Expand Down
Loading

0 comments on commit 6c86ae0

Please sign in to comment.