I have been doing some stress testing on cesium to get a base line for the number of geometries I would be able to render at one time. When I try to draw circles I found that a HUGE amount of memory was being used to create just one circle (around 750KB). I was just curious if there was a more efficient way to create a circle or if this is something I will have to work around. Below is a snippet of my test code...
var primitives16circ = new Cesium.PrimitiveCollection();
var size = 1;
var count=0;
var appear = new Cesium.PerInstanceColorAppearance({
closed: true
})
for (var lon=-180;lon<=180-size*2;lon=lon+size*5)
{
for (var lat=-90;lat<=90-size*2;lat=lat+size*5)
{
count++;
var circleGeometry = new Cesium.CircleGeometry({
center : Cesium.Cartesian3.fromDegrees(lon, lat),
radius : 50000.0
});
var redCircleInstance = new Cesium.GeometryInstance({
geometry : circleGeometry,
attributes : {
color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 0.0, 0.0, 0.5))
}
});
// Add the geometry instance to primitives.
primitives16circ.add(new Cesium.Primitive({
geometryInstances: [redCircleInstance],
appearance: appear
}));
}
}
primitives.add(primitives16circ);
I am currently using version b30 of Cesiumjs. I also tried changing the granularity and this did reduce the amount of memory required but I am still curious if there are other options I am over looking.
Thanks for your help!
Daniel
var viewer = new Cesium.Viewer('cesiumContainer', {scene3DOnly: true});var instances = [];
var size = 1;var count=0;
for (var lon=-180;lon<=180-size*2;lon=lon+size*5){for (var lat=-90;lat<=90-size*2;lat=lat+size*5){count++;var circleGeometry = new Cesium.CircleGeometry({center : Cesium.Cartesian3.fromDegrees(lon, lat),
radius : 50000.0,granularity : 5 * Cesium.Math.RADIANS_PER_DEGREE
});var redCircleInstance = new Cesium.GeometryInstance({geometry : circleGeometry,attributes : {color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 0.0, 0.0, 0.5))}});
instances.push(redCircleInstance);
}}var appear = new Cesium.PerInstanceColorAppearance({closed: true
});viewer.scene.primitives.add(new Cesium.Primitive({geometryInstances: instances,appearance: appear,allowPicking: false}));
--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.