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

Vertical Polygon ("Vertigon") Drawing: How to do it? #6662

Closed
silky opened this issue Jun 6, 2018 · 4 comments
Closed

Vertical Polygon ("Vertigon") Drawing: How to do it? #6662

silky opened this issue Jun 6, 2018 · 4 comments

Comments

@silky
Copy link

silky commented Jun 6, 2018

Consider:

image

Generated from the following code in the Sandcastle:

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

var redPolygon = viewer.entities.add({
    name : 'Red polygon vertically',
    polygon : {
        perPositionHeight: true,        
        hierarchy : Cesium.Cartesian3.fromDegreesArrayHeights([111.0, 33, 140000.0,   // 1
                                                               111.0, 33, 100000.0,   // 2
                                                               116.0, 33, 100000.0,   // 3
                                                               116.0, 33, 140000.0,   // 4
                                                               114.0, 33, 180000.0]), // 5
        material : Cesium.Color.RED.withAlpha(0.6)
    }
});

var bluePolygon = viewer.entities.add({
    name : 'Blue polygon on surface',
    polygon : {
        perPositionHeight: true,        
        hierarchy : Cesium.Cartesian3.fromDegreesArrayHeights([111.0, 35, 100000.0,   // 1
                                                               111.0, 33, 100000.0,   // 2
                                                               116.0, 33, 100000.0,   // 3
                                                               116.0, 35, 100000.0,   // 4
                                                               114.0, 38, 100000.0]), // 5
        material : Cesium.Color.BLUE.withAlpha(0.6)
    }
});

viewer.zoomTo(viewer.entities);

The vertical (red) polygon is not drawn correctly (it's missing the bottom part of the house-like shape). I've projected it in blue below to show how it should look. In general this makes vertical polygon drawing problematic.

Another example (without code to reproduce) to show the kind of problems we get:

image

I believe this is related to #2897

I'm not sure what the current status on fixing this kind of issue is though.

Anyone have any thoughts?

At the moment I feel like I could potentially solve it by computing my own triangulation and adding those geomerties to a mesh; but in my particular case not all the polygons are going to be convex, so it'll be a bit involved to do the work.

Appreciate any advice!

@hpinkos
Copy link
Contributor

hpinkos commented Jun 6, 2018

Hi @silky! Our polygons are designed to curve to the ellipsoid surface and therefore they cannot take any arbitrary points and draw a polygon in space. We do have an issue open for this: #3349

I have an incomplete branch that supports the kind of thing you're trying to do here: https://github.com/AnalyticalGraphicsInc/cesium/tree/space-polygon

I'm going to close this as a duplicate, but I'll make a comment in #3349 so we can notify you when we have a chance to add this feature

@silky
Copy link
Author

silky commented Jun 7, 2018

interesting, thanks @hpinkos

@silky silky changed the title Vertical Polygon Drawing: How to do it? Vertical Polygon ("Vertigon") Drawing: How to do it? Jul 4, 2018
@mihaiMoise
Copy link

Thank you @silky for the Sandcastle! With your help, I finally found out how to draw an inclined Polygon!

@OmarShehata
Copy link
Contributor

If you haven't found it, it's the new CoplanarPolygonGeometry that allows you to do this.

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

No branches or pull requests

4 participants