Tracking a CZML defined entity with rotation from a fixed distance

Hi , How do i track an entity with a fixed distance behind? Using matrices multiplication from other answers does not give tracking with a fixed distance, I am looking for a way to follow an entity along a czml path with an adjustable diagonal distance behind the entity. Mainly, The camera should also rotate according the heading of the path.

Code: Link
Side note: For self learning, how do i calculate the “direction” and “up” from HeadingPitchRoll for the set view options?

There isn’t a built-in way to do this, but there is some discussion on it in this GitHub issue: https://github.com/CesiumGS/cesium/issues/5241

You may also find these other discussions on the forum helpful, like for computing the orientation: Create a point in a direction In Cesiumjs, or this one: Do not move camera when setting trackedEntity.