Copy Entity Positions to Point Primitive Position

1. A concise explanation of the problem you’re experiencing.

I have an array of positions (time, x, y, z) from an entity that I would like to “copy and paste” to point primitive position. I had tried to print out the properties of the point primitive position but nothing prints out.

It looks like maybe the point primitive does not like the “extra fluff” that the entity position provides - perhaps this is why it does not work.

2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.

var points = viewer.scene.primitives.add(new Cesium.PointPrimitiveCollection());

var entPositions = ent.position;

var pt = points.add({

position : entPositions,

color : color,

pixelSize : 10

});

console.log(pt); // no result here

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

I have been experimenting with ingesting a large amount of data points and would like to use the point primitive route as suggested by this link: https://cesium.com/blog/2016/03/02/performance-tips-for-points/#code-for-table-4

Given the entity position array of values (time, coordinates), I wish to copy this to the point primitives so that the viewer is able to animate the points according to these entity position values.

Thank you for your help!

4. The Cesium version you’re using, your operating system and browser.

I figured out how to access the time and cartesian values separately by the following:

var times = ent.position._property._times;

var values = ent.position._property._values;

var epoch = ent.availability.start;

I guess I could dismiss using the times because they should be incremented by 60 seconds by each set of cartesian values.

How do I use what I have now to set these values such as position and epoch to the point primitive?

Why are you using entities then copying their positions into a primitive? Without knowing more about your setup, that sounds like it would be slower than just using entities, or just using primitives.

Have you tried printing ent.position? Since entities are time-dynamic, if you want to get the value directly, you need to do ent.position.getValue(time) instead of just ent.position.

Omar,

I am generating czml from a TLE and grabbing the positions from that CZML. Since I have many TLEs, I would like to visualize them in Cesium using point primitives or billboards for increased performance. This is why I'm trying to "copy" the positions from that CZML into a point primitive or billboards. Currently, I'm not adding czml from the generated TLEs but just obtaining the information from it. This is more like AGI's Spacebook application.

How would I go about to incorporate time dynamic Cartesian position data to point primitives or billboards?

I also looked at the following link for help but I could not discern how to update many (18000) point primitive or billboards using positional data that I already have generated.