Hi everyone.
I am a newbie with cesium.
When I draw and manage 10000 ~ 100000 spheres, I am finding more effective method.
-
draw and add every spheres
for(i=0; i< 10000;i++)
{
entity[i] = viewer.entities.add({
name : i,
position : any_position,
show : show,
ellipsoid: {
radii : new Cesium.Cartesion3(radius, radius, radius),
material: any_color,
},
label : {
text: i,
scale: 0.4
}
});
} -
add and change a position after clone a entity
var entity_base = viewer.entities.add({
name : any_name,
position : any_position,
ellipsoid: {
radii : new Cesium.Cartesion3(radius, radius, radius),
material: any_color,
show : false
},
label : {
text: i,
scale: 0.4,
show: false
}
});
for(i=0; i< 10000;i++)
{
var entity1 = Cesium.clone(entity_base);
entity1.position = any_position;
entity1.name = i;
entity1.ellipsoid.color = any_color;
entity1.label.text = i;
entity[i] = viewer.entities.add(entity1);
entity[i].ellipsoid.show = true;
entity[i].label.show = true;
}
Which method is more effective ?