My polyline is rotating with the earth!

I have created a polyline in Cesium by converting an array of x y z coordinates to Cartesian3 objects

var redPos = [array of x y z coordinates];
function arrayToCartesianArray(array) {
let newArray = ;
for (let i = 0; i < array.length; i+=3){
let p = new Cesium.Cartesian3(array[i], array[i+1], array[i+2]);
newArray.push(p);
}

return newArray;
}

viewer.entities.add({
id: ‘test’,
polyline: {
positions: arrayToCartesianArray(redPos),
width: 1,
material: Cesium.Color.RED,
arcType: Cesium.ArcType.NONE,
},
});

The issue is that whenever I run the clock the polyline rotates along with the Earth which I don’t want. How can I get the line to stay still? Thanks.

Hi @mikeyboy897, welcome to the community!

By default, positions are defined in “fixed frame”, which is Earth-centered, Earth-fixed.

If you want your polyline to remain fixed relative to the stars, then you probably need to look at ReferenceFrame.INERTIAL, which lets you define positions in the International Celestial Reference Frame. Your positions will need to be supplied as a PositionProperty, which lets you define the reference frame.

You may also want to set your camera view in ICRF. See the options in the Camera Sandcastle.