Corridor renders from Primitive API but not Entity API
See original GitHub issueFrom #4326
This corridor renders:
var viewer = new Cesium.Viewer('cesiumContainer');
var scene = viewer.scene;
var redCorridorInstance = new Cesium.GeometryInstance({
geometry: new Cesium.CorridorGeometry({
positions : Cesium.Cartesian3.fromDegreesArray([
-16.41549000000001,28.44423000000001,
-16.41549000000001,28.44423000000001,
-16.41505000000001,28.44430000000001,
-16.41507000000001,28.44430000000001,
-16.41473000000001,28.44460000000001,
-16.41429000000001,28.44452000000001,
-16.41430000000001,28.44453000000001,
-16.41428000000001,28.44452000000001,
-16.41416000000001,28.44434000000001,
-16.41415000000001,28.44434000000001,
-16.41397000000001,28.44408000000001
]),
width : 1,
vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT
}),
attributes : {
color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 0.0, 0.0, 0.5))
}
});
var primitive = scene.groundPrimitives.add(new Cesium.GroundPrimitive({
geometryInstances: [redCorridorInstance],
appearance: new Cesium.PerInstanceColorAppearance({
closed: true
})
}));
scene.camera.setView({
destination: Cesium.Cartesian3.fromDegrees(-16.41549000000001, 28.44423000000001, 100)
});
But this one doesn’t
var viewer = new Cesium.Viewer('cesiumContainer');
var redCorridor = viewer.entities.add({
name : 'Red corridor on surface with rounded corners and outline',
corridor : {
positions : Cesium.Cartesian3.fromDegreesArray([
-16.41549000000001,28.44423000000001,
-16.41549000000001,28.44423000000001,
-16.41505000000001,28.44430000000001,
-16.41507000000001,28.44430000000001,
-16.41473000000001,28.44460000000001,
-16.41429000000001,28.44452000000001,
-16.41430000000001,28.44453000000001,
-16.41428000000001,28.44452000000001,
-16.41416000000001,28.44434000000001,
-16.41415000000001,28.44434000000001,
-16.41397000000001,28.44408000000001
]),
width : 1,
material : Cesium.Color.RED.withAlpha(0.5),
outline : true,
outlineColor : Cesium.Color.RED
}
});
viewer.zoomTo(viewer.entities);
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Primitive - Cesium Documentation
optional The geometry instances - or a single geometry instance - to render. appearance, Appearance, optional The appearance used to render the primitive....
Read more >angular-cesium - npm
Create map based applications using cesium and angular2 components. Focusing on high performance with easy usage. Check out our Demo that contains small...
Read more >City Sample Project Unreal Engine Demonstration
An overview of the features used to create the City Sample learning example project for Unreal Engine.
Read more >Viewer - Cesium Documentation
The DOM element or ID that will contain the widget. options, Object, optional Object with the following properties: Name, Type, Default ...
Read more >Entity Collection Rendering - Google Groups
I'm trying to visualize a custom GeoJSON dataset of a big city. At the moment, I'm able to parse the GeoJSON, to calculate...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@CHBaker try changing the value of the granularity attribute. This is a value in radians that specifies the distance at which the line should be subdivided and pushed to the ellipsoid surface. Here’s an illustration to show what I’m talking about:
For a really large number, the line will just cut through the ellipsoid. A smaller value will break the line up to better fit the curvature.
By default, it subdivides the line each degree (
Math.PI/180radians). A smaller value might work better for your case.Alright, I think that did it, thanks!