Primitives versus Entities

Matthew,

If you do have time at some point I'd love to know if I was doing something wrong with the entity approach. From all I've read about the Entity API it seems like updating the size and color of 1000 ellipsoids shouldn't be a big deal from a performance standpoint.

My last attempt at the entity approach (after I updated the getColor and getVisiblity methods per your direction) had everything working. The performance, however, was really poor.

Thanks for any guidance...

Rob

I see that the EllipsoidGraphics subdivisions, stackPartitions and slicePartitions are properties. So I'm suspicious that the performance hit is because I'm not setting these properties correctly in the CallbackProperty functions.

In order to get the material property to update correctly the ColorMaterialProperty had to be set with the CallbackProperty function.

Can someone explain to me how to properly set the subdivision, stackPartition and slicePartition properties in a CallbackProperty function? I'm not sure what property object to use.

Here's the creation of the ellipsoid entity I'm using...

cesiumViewerEntities.add({
    parent: vorEntities,
    position: Cesium.Cartesian3.fromDegrees(LON, LAT, 0.0),
    ellipsoid: {
        radii: new Cesium.CallbackProperty(getSize, false),
        material: new Cesium.ColorMaterialProperty(new Cesium.CallbackProperty(getColor(MON), false)),
        show: new Cesium.CallbackProperty(getVisibility(MON), false),
        subdivisions: new Cesium.CallbackProperty(getSubdivisions, false)
        stackPartitions: new Cesium.CallbackProperty(getPartitions, false),
        slicePartitions: new Cesium.CallbackProperty(getPartitions, false)
    },
    MON: MON
});

Hi Rob,

Can you please paste a code sample? Using the example I gave you, I would expect the ellipsoids to remain on the surface.

Thanks!

-Hannah

Hi Hannah,

I've realized that this issue is related to using 3D terrain. Whether I use primitives or entities I can't force the ellipsoids or points onto the surface when I am using 3D terrain. Is there any way to force the ellipsoids or points to sit on the surface?

Below is a simple example for Sandcastle. If you zoom in close to the point and tilt the globe you'll see that the point is elevated. If you comment out the terrain provider then the point will be sitting on the globe.

var viewer = new Cesium.Viewer(‘cesiumContainer’, {
            animation: false,
            baseLayerPicker: false,
            fullscreenButton: false,
            geocoder: false,
            homeButton: false,
            infoBox: false,
            sceneModePicker: false,
            selectionIndicator: false,
            timeline: false,
            navigationHelpButton: false,
            navigationInstructionsInitiallyVisible: false,
            scene3DOnly: true,
            terrainProvider: new Cesium.CesiumTerrainProvider({
                url: ‘http://assets.agi.com/stk-terrain/world’,
                credit: ‘’
            })
        });

viewer.entities.add({
    position : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
    point : {
        pixelSize : 10,
        color : Cesium.Color.YELLOW
    }
});

You can use the sampleTerrain to query the terrain for the positions with height.
Take a look at this example: http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Terrain.html&label=Showcases

Look for the ‘Sample Everest Terrain’ function to see how sampleTerrain is used

-Hannah

Hi Hannah,

Just wanted to follow up and say that the “sampleTerrain” method worked great! This solved the issue with placing the objects “on the terrain”.

Thanks for your help with this!

Rob

Great! Glad I was able to help =)

-Hannah

@Matt_Amato I know this is a really old thread but I stumbled on it really struggling to get the best performance when playing back data. I was using a SampledPositionProperty but my FPS would drop really low (~3 FPS) as more data is added. The memory would reach around 250 MB which is higher than I’d like but acceptable.

When I tried using callbacks the memory was amazingly low (staying below 100 MB) but the FPS was a bit worse than using SampledPositionProperty. I suspect the processing I’m doing each time a callback is made.

After reading your suggestion earlier in this thread about the TimeIntervalCollectionProperty, I tried a TimeIntervalCollectionPositionProperty. This turned out to be a great option! The memory usage was about equal to the SampledPositionProperty but the FPS was great. Even with a lot of data (close to 200K points during playback) it never dipped below 10 FPS.

Anyway, there may be room for further performance improvements but I just wanted to say thanks to you and put this out there if anyone else is struggling with playing back a large amount of data.

Patrick