Rectangle following a flight tracker

Hi all.
I’m new in Cesium and in JS.
Is there a way to draw a rectangle following a flight tracker that uses a 3D model?


Hi! You can use a rectangle entity and change its position based on the position of the 3D model. Here is an example using a path entity instead, but the rectangle entity would have a similar concept: Sandcastle. Note that path in the example has multiple points for positions, but a rectangle only has one position.

Thanks for your help.
I share my code to help others beginners:

async function loadModel() {
// Load the glTF model from Cesium ion.
const airplaneUri = await Cesium.IonResource.fromAssetId(284344);
for (let i = 0; i < positionProperties.length; i++) {
description: Fly: ${fligthsIdentifiers[i]},
availability: new Cesium.TimeIntervalCollection([
new Cesium.TimeInterval({ start: start, stop: stop }),
position: positionProperties[i],
model: {
uri: airplaneUri,
minimumPixelSize: 68,
maximumScale: 10,
color: Cesium.Color.RED,
// Automatically compute the orientation from the position.
orientation: new Cesium.VelocityOrientationProperty(
path: new Cesium.PathGraphics({
width: 3,
material: Cesium.Color.YELLOW,
leadTime: 20,
trailTime: 0,

            position: positionProperties[i],
            point: {
              color: Cesium.Color.ALICEBLUE,
              pixelSize: 20,
              outlineColor: Cesium.Color.RED,
              outlineWidth: 1,

          //viewer.trackedEntity = airplaneEntity1;
            destination: Cesium.Cartesian3.fromDegrees(
            orientation: {
              heading: Cesium.Math.toRadians(90.0),
              pitch: Cesium.Math.toRadians(-90.0),
              roll: 0.0,


1 Like