Drawing a Polyline in certain directions relative to an object

Hello all,

I am trying to draw polylines that start from a specified point, and point out to another point that is a certain distance and direction away. Do objects in Cesium have a sense of what is "Forward"? Is it possible to draw a line that follows an objects "Forward" unit vector?

Say I have a satellite defined in CZML that I load into a Cesium example. This satellite is orbiting Earth. I would like to be able to draw a line from its center position (getting that is easy enough) to say 1000 meters out following its "Forward" vector.

Is this possible?

Thanks a lot in advance!

What you are looking for is the ability to query an Entity for velocity information. Cesium doesn’t currently expose a way to do that but it’s on the long-term roadmap. Technically you could do this yourself via finite differencing but the actual implementation of that is beyond my math skills. A “poor mans” way of doing this would be to get the positions at “now” and “now +1” and then subtract and normalize them. This will give you an approximation of what you want but there are plenty of cases where it won’t be correct (dependaning on how the object is moving). Well-behaved object, like satellites, would probably work fine.