Skip to content
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

Improve extruded PolygonGeometry with perPositionHeight #2924

Open
hpinkos opened this issue Aug 6, 2015 · 2 comments
Open

Improve extruded PolygonGeometry with perPositionHeight #2924

hpinkos opened this issue Aug 6, 2015 · 2 comments

Comments

@hpinkos
Copy link
Contributor

hpinkos commented Aug 6, 2015

PolygonGeometry assumes the points with perPositionHeight are on the top, so when the extrudedHeight is greater than the position heights, the shape is inside out.

var viewer = new Cesium.Viewer('cesiumContainer');
var scene = viewer.scene;

var positions = Cesium.Cartesian3.fromDegreesArrayHeights([
    -108.0, 25.0, 100000,
    -100.0, 25.0, 100000,
    -100.0, 30.0, 100000,
    -108.0, 30.0, 300000
]);

var orangePolygonInstance = new Cesium.GeometryInstance({
    geometry : Cesium.PolygonGeometry.fromPositions({
        positions : positions,
        extrudedHeight: 400000,
        vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,
        perPositionHeight : true
    }),
    attributes: {
        color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.ORANGE)
    }
});

scene.primitives.add(new Cesium.Primitive({
    geometryInstances : orangePolygonInstance,
    appearance : new Cesium.PerInstanceColorAppearance({
        closed : true,
        translucent : false
    })
}));

Found in #2923

Bonus: it might be neat to be able to specify a top and bottom height per position.

@hpinkos hpinkos changed the title Improve extrusion PolygonGeometry with perPositionHeight Improve extruded PolygonGeometry with perPositionHeight Aug 6, 2015
@hpinkos hpinkos added the 2.0 label Apr 26, 2016
@hpinkos hpinkos mentioned this issue Apr 26, 2016
@hpinkos hpinkos removed the 2.0 label Feb 13, 2017
@hpinkos
Copy link
Contributor Author

hpinkos commented Aug 30, 2018

@hpinkos
Copy link
Contributor Author

hpinkos commented Jun 12, 2020

Also reported in #8416

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants