-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
KML linestring clamp to ground fails #4326
Comments
Here's another example from https://groups.google.com/forum/?hl=en#!topic/cesium-dev/7h3W_ICb4wM |
This is a corridor geometry bug but only happens when clamping to ground (remove height in the below to break it). 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,
height:0,
material : Cesium.Color.RED.withAlpha(0.5),
outline : true,
outlineColor : Cesium.Color.RED
}
});
viewer.zoomTo(viewer.entities); |
This is happening because the bounding box/shadow volume minimum isn't quite low enough. For small shapes it's equal with the level of the tile and results in z-fighting. See #4485 for discussion |
Also reported here: https://groups.google.com/d/msg/cesium-dev/hEuF6TWyKdQ/32CP1WhEBQAJ |
This one still seems to be a problem, unfortunately 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); |
This one is still broken as well #4326 (comment) |
@hpinkos check out the debug views for these. Does it matter if they are on terrain or on the ellipsoid? Does hacking in a large negative direction solve the problem? Or is this because the width is defined in meters, not pixels, so the volume becomes very thing? |
The corridor now renders correctly when added using the Primitive API, but not the Entity API 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)
}); So the problem is unrelated to the shadow volume problem |
If someone wants to look at this, the geometry for the Corridor is created in |
I'm going to open a new issue with more specific details since we fixed the shadow volume problem. |
Reported on the forum: https://groups.google.com/forum/?hl=en#!topic/cesium-dev/9wvnNNQcLTA
This KML renders fine when
clampToGround: false
but doesn't render anything whenclampToGround: true
. Zooming to it then causes a crash inScene updateFrustums
because NaNs populate the frustum values.track.kml.txt
The text was updated successfully, but these errors were encountered: