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

Corridor outline #1099

Merged
merged 12 commits into from
Sep 3, 2013
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,49 +778,80 @@
})
}));

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 : 1.0}))
}
});

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 : 1.0}))
}
});

primitives.add(new Cesium.Primitive({
geometryInstances : [corridorInstance, extrudedCorridorInstance],
geometryInstances : [corridor, extrudedCorridor, corridorFill],
appearance : new Cesium.PerInstanceColorAppearance({
translucent : false,
closed : 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
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ var geometry = BoxGeometry.createGeometry(box);
* Replaced `createPickFragmentShaderSource` with `createShaderSource`.
* Renamed `PolygonPipeline.earClip2D` to `PolygonPipeline.triangulate`.
* Added outline geometries. [#1021](https://github.com/AnalyticalGraphicsInc/cesium/pull/1021).
* Added `CorridorGeometry`.
* Added `CorridorGeometry` and `CorridorOutlineGeometry`.
* Added `Billboard.scaleByDistance` and `NearFarScalar` to control billboard minimum/maximum scale based on camera distance.
* Added `EllipsoidGeodesic`.
* Added `PolylinePipeline.scaleToSurface`.
Expand Down
Loading