Open hpinkos opened 7 years ago
Related forum posts: https://groups.google.com/forum/?hl=en#!topic/cesium-dev/9wvnNNQcLTA https://groups.google.com/forum/?hl=en#!topic/cesium-dev/7h3W_ICb4wM
Another example:
positions : Cesium.Cartesian3.fromDegreesArray([
43.0298791905732,30.3249511347621,
43.0535143723772,30.3254863499896,
43.0531351413855,30.217161279318,
43.0300902644761,30.2171721034287,
43.0298791905732,30.3249511347621
]),
From @mramato
If someone wants to look at this, the geometry for the Corridor is created in CorridorGeometryUpdater.createFillGeometryInstance and then it's used in StaticGroundGeometryColorBrach in the createPrimitive block around line 86. There's probably an unrelated bug specific to CorridorGeometry in the Entity API.
I think I am having the same issue, but with polylines. I get the z-fighting you referenced in the related issue. Is there a fix for this yet?
I have an example on the sandcastle running this code:
var viewer = new Cesium.Viewer('cesiumContainer', { infoBox : false });
var entities = viewer.entities;
entities.add({
polyline : {
positions : Cesium.Cartesian3.fromDegreesArray([-111.0, 40.0,
-95.0, 40.0]),
width : 3,
material : Cesium.Color.RED,
heightReference : Cesium.HeightReference.CLAMP_TO_GROUND
}
});
viewer.zoomTo(viewer.entities);
Hi @CHBaker. Polylines don't have a heightReference
property and do not support being clamped to terrain. They will curve to fit the ellipsoid automatically though.
@hpinkos hmmm. I saw some posts about adding this feature in 2015, guess it never got added. The problem I have is two polylines crossing at a perfetc '+' sign, but when you zoom in one is floating above the other, so when you ctrl + click to move perspective the lines move a lot and do not lay directly on top of each other.
This only occurs once you zoom in very close, they lay directly on top of each other, but once cesium renders as close as you can get, they don't appear on top of each other
@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/180
radians). A smaller value might work better for your case.
Alright, I think that did it, thanks!
From #4326
This corridor renders:
But this one doesn't