CesiumGS / cesium

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:
https://cesium.com/cesiumjs/
Apache License 2.0
12.94k stars 3.49k forks source link

Polylines normal to the earth's surface disappear in 2D #94

Open mramato opened 12 years ago

mramato commented 12 years ago

It's pretty simple, if a line is normal to the earth, it disappears in 2D. Ideally, we would use the width and outline of the line to turn it into a point in 2D mode. We have some code in DynamicScene that creates points on the fly using billboards, we might be able to adapt/refactor that out for this use case as well. I have an example CZML that shows the issue if anyone wants to look at this.

pjcozzi commented 12 years ago

We probably want to fix this in the polyline; otherwise people using the API directly will need the same logic. It should be pretty straightforward.

mramato commented 12 years ago

I agree, I was just pointing out we had code that generated outlined points of arbitrary size. I definitely think it needs to be handled at the Polyline layer.

mramato commented 10 years ago

This also happens with WallGeometry

hpinkos commented 7 years ago

Code example:

var viewer = new Cesium.Viewer('cesiumContainer', {
    sceneMode: Cesium.SceneMode.SCENE2D
});

viewer.entities.add({
    polyline : {
        positions : Cesium.Cartesian3.fromDegreesArrayHeights([-75, 35, 0,
                                                        -75, 35, 1000000]),
        width : 5,
        material : Cesium.Color.RED
    }
});

viewer.entities.add({
    wall : {
        positions : Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 44.0, 200000.0,
                                                               -90.0, 44.0, 200000.0]),
        minimumHeights : [100000.0, 100000.0],
        material : Cesium.Color.RED
    }
});
mramato commented 7 years ago

Also reported on the forum: https://groups.google.com/d/msg/cesium-dev/ZGV9jpxMSIE/9L_MW_ZGAQAJ

For walls, I think we can get to good enough at the KML level by always adding an outline to walls of the same color as the geometry (unless the wall itself specifies a different color in the KML). It should just be a small change in KmlDataSource.js (and the tests).

pjcozzi commented 7 years ago

KML fix: #4961