I like to visualize several entities that move around. Rather than constantly updating the position of each entity (by sending the position data from a simulator through e.g. a websocket connection), I like to off-load the updating to Cesium using dead reckoning models. I looked at SampledPositionProperty, we may be able to support this, but I have really no clue how to get that working.
Does Cesium support DIS-style dead reckoning? I.e. first order derivative of position change / velocity.
If so, how can this be done? Is there a simple example you can point me to?
2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.
Currently, the position updates are static and transmitted every so many seconds causing overhead.
Code snippet to create entity:
var billboard = {
image: sym.asCanvas(), //Get the canvas for the billboard
pixelOffset: new Cesium.Cartesian2(-sym.markerAnchor.x, -sym.markerAnchor.y), // Symbol offset
eyeOffset: new Cesium.Cartesian3(0.0, 0.0, 0.0), // default
horizontalOrigin: Cesium.HorizontalOrigin.LEFT, // default
verticalOrigin: Cesium.VerticalOrigin.TOP};
var entity = {
id: milsym.id,
billboard: billboard,
};
var position = new Cesium.Cartesian3(milsym.geocentricPosition.x, milsym.geocentricPosition.y, milsym.geocentricPosition.z);
entity.position = new Cesium.ConstantPositionProperty(position);
viewer.entities.add(entity);
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
N/A
4. The Cesium version you're using, your operating system and browser.
Version 1.53. FF en GC on Windows 10.
A better way is - I assume - using Cesium.CallbackProperty. When the callback is triggered, the position for the requested time should be returned. This position should be dead reckoned from the last received websocket update. I have done this yet. When and how often is the callback called? Do I have control over the call rate?
Once I have this in place I also like to visualize the path that the entity traversed. Although this is another questions, I like to know how to do this as well.
I am happy to post code once I get callback option going, hopefully with track display included. Any help appreciated.
When and how often is the callback called? Do I have control over the call rate?
From the cesium spec it is unclear if the callback only moves time forward, i.e. if every callback is for a time greater than the previous invocation. If so I can do the dead-reckon calculation in the callback function.
Currently I use a ConstantPositionProperty for each entity, which I update at a rate of 10Hz to get relatively smooth movement on the display. When I use the Cesium callback the update rate is determined by Cesium, 2 x fps, right? How does this work out performance-wise for say 1000-1500 entities?
From the cesium spec it is unclear if the callback only moves time forward, i.e. if every callback is for a time greater than the previous invocation.