why the Geometry cutted by the horizon and the geometry disappear when zooming

Hi, happy new year

I meet a problem when I add some CylinderGeometry with Primitive API,

the geometry can be seen when the camera stays far away from the surface, like the first annex.

When I zoomIn, the geometry disappears and cutted by the horizon,

the part beyond horizon can be seen, and geometry below the horizon disappear, like the second annex.

I found a title here https://groups.google.com/forum/#!topic/cesium-dev/7ZDpbvjzhgY, which caused by disabling ANGLE,

what confused me is that the porblem appears just in Mac no matter what browser I use, but runs well in windows system.

here is my function to render the geometry

//the entities come from a promise
renderHistogram: function(entities, config, cid){
    var color = Cesium.Color.fromCssColorString(config.markerColor).withAlpha(config.markerOpacity);
    var len = entities.length;

    var instances = [];
    for(var i = 0; i < len; i++){
        var geometry = new Cesium.CylinderGeometry({
            length : 50000,
            topRadius : 10000,
            bottomRadius : 10000,
            slices: slices,
            vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT
        });
        entities[i].billboard = undefined; //todo: why there is a billboard at the very beginning
        var position = entities[i].position._value;
        var instance = new Cesium.GeometryInstance({
            geometry: geometry,
            modelMatrix: Cesium.Matrix4.multiplyByTranslation(
                Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromElements(position["x"], position["y"], position["z"],new Cesium.Cartesian3())),
                new Cesium.Cartesian3(0.0,0.0, 0.0),new Cesium.Matrix4()
            ),
            attributes: {
                color : Cesium.ColorGeometryInstanceAttribute.fromColor(color),
                distanceDisplayCondition : new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(10.0, 50000000.0)
            },
            id: i
        });

        instances.push(instance)
    }

    primitive = new Cesium.Primitive({
        geometryInstances: instances,
        appearance: new Cesium.PerInstanceColorAppearance({
            closed : true,
            translucent: true,
            flat: false,
            faceForward: false
        }),
        allow3DOnly: true,
        vertexCacheOptimize: true,
        allowPicking: true,
        releaseGeometryInstances: false,
        cull:false
    });

    this.globe.scene.primitives.add(primitive);
},

``

anyone could help?

Hello,

I believe this is happening because half of the cylinder is under the earth surface. The model is centered around 0,0, so if you want it to display on the surface you need to translate it up by half the length. Here is an example:

var modelMatrix = Cesium.Matrix4.multiplyByTranslation(
Cesium.Transforms.eastNorthUpToFixedFrame(positionOnEllipsoid),
new Cesium.Cartesian3(0.0, 0.0, length * 0.5), new Cesium.Matrix4()
);

``

Best,

Hannah

Hello,

Thanks a lot but it not work.

The problem may caused by System or Graphics card. Because it works well in a PC with Windows System but breakdown in a Mac( mac pro with a graphics card Intel Iris Graphics 6100).

finally, I solve it by set the translucent false, like this

    primitive = new Cesium.Primitive({
        geometryInstances: instances,
        appearance: new Cesium.PerInstanceColorAppearance({
            closed : true,
            translucent: false // Transparency forbidden makes the geometries won't appear on the other side of the earth globe
        })
    });

``

But I don’t know why.

在 2017年1月3日星期二 UTC+8下午11:58:01,Hannah Pinkos写道:

Hello Hannah,

It works well now by translating it up by half the length, thank you.

What makes the geometry disappears is depthTestAgainstTerrain, the disadvantage is described clearly in the doc, but I didn’t read it in detail. ╮(╯_╰)╭

Best,

CL
在 2017年1月3日星期二 UTC+8下午11:58:01,Hannah Pinkos写道: