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

Cesium GroundPrimitive and Polygon on Terrain Rendering #2

Closed
jamiesampey opened this issue Sep 20, 2015 · 7 comments
Closed

Cesium GroundPrimitive and Polygon on Terrain Rendering #2

jamiesampey opened this issue Sep 20, 2015 · 7 comments
Labels

Comments

@jamiesampey
Copy link
Owner

KML Graphics Roadmap: CesiumGS/cesium#2179

Vector Data on Terrain: CesiumGS/cesium#2172
Request for issue 2172: https://groups.google.com/forum/#!searchin/cesium-dev/polyline$20on$20terrain/cesium-dev/xqUZ-JUIxjU/sXfjXBxsa4EJ

Polygon on Terrain: CesiumGS/cesium#2618

@jamiesampey
Copy link
Owner Author

Cesium 1.13 included polygon on terrain rendering. release notes: http://cesiumjs.org/2015/09/01/Cesium-version-1.13-released/

The main class is GroundPrimitive which takes a GeometryInstance. Only one GroundPrimitive-wrapped GeometryInstance can be added at a time. Batching is not supported "at this time."

http://cesiumjs.org/Cesium/Build/Documentation/GroundPrimitive.html?classFilter=ground

It's probably better to use this class and not worry about manually "floating" the polygon a meter above the surface. Plus, hopefully any future advancements will use this class.

@jamiesampey
Copy link
Owner Author

AvyEyesView.prototype.addAvalanche = function(avalanche) {
    var avalanchePolygon = new Cesium.GeometryInstance({
        id: avalanche.extId,
        geometry: new Cesium.PolygonGeometry({
            polygonHierarchy: {
                positions: Cesium.Cartesian3.fromDegreesArrayHeights(avalanche.coords)
            }
        }),
        attributes: {
            color: new Cesium.ColorGeometryInstanceAttribute(1.0, 0, 0, 0.4)
        },
        appearance: new Cesium.PerInstanceColorAppearance({
            translucent: false
        })
 });

 this.cesiumViewer.scene.primitives.add(new Cesium.GroundPrimitive({
      geometryInstance: avalanchePolygon
 }));

    return avalanchePolygon;
}

and 

 $.getJSON("/rest/avydetails/" + pick.id, function(data) {

get pretty close, but I need to send a target ENTITY into flyTo()

@jamiesampey jamiesampey changed the title Investigate Cesium KmlDataSource and Polygon on Terrain Rendering Cesium KmlDataSource and Polygon on Terrain Rendering Oct 13, 2015
@jamiesampey
Copy link
Owner Author

10/19/2015 INVESTIGATION

Use KML? https://cesiumjs.org/2015/05/07/New-KML-Examples/

Three required pieces for avalanche display:

  1. Can I fly to it? YES for KML and Entities, no for GroundPrimitive.
  2. Can I pick it? YES for KML, Entities, and GroundPrimitive.
  3. Can I drape it over terrain? Yes for GroundPrimitive, sort of for Entities, NO for KML.

Vector Data on Terrain: CesiumGS/cesium#2172

https://groups.google.com/forum/#!searchin/cesium-dev/kml$20ground$20terrain/cesium-dev/xz2xwKogybY/jt8h174rknwJ

https://groups.google.com/forum/#!searchin/cesium-dev/kml$20ground$20terrain/cesium-dev/ixhw1BrmvJM/PhVXCHFA8XcJ

@jamiesampey
Copy link
Owner Author

Intermediate idea until KML or entities drape over terrain (#2172):

Make a draping ground primitive for each avy. The groundprimitive will handle the picking.

Make a "companion" entity for a fly to. Remove the entity immediately after the fly to leaving only the pickable, draped GroundPrimitive.

@jamiesampey jamiesampey changed the title Cesium KmlDataSource and Polygon on Terrain Rendering Cesium GroundPrimitive and Polygon on Terrain Rendering Nov 17, 2015
@jamiesampey
Copy link
Owner Author

Created this forum topic on 11-2-2015: https://groups.google.com/forum/?hl=en#!topic/cesium-dev/6qt-wb-SohY

which resulted in this bug submitted on 11-5-2015: CesiumGS/cesium#3171

@jamiesampey
Copy link
Owner Author

This seems to have gotten better. Probably not completely fixed, but no plans to do further work on this right now.

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

No branches or pull requests

1 participant