CesiumJS Sandcastle: computeIcrfToFixedMatrix

Why do the computeIcrfToFixedMatrix and other EOP related functions not work in the sandcastle?

The below outputs:

time: 2024-08-02T20:46:03.3070000000006985Z
fixedToInertialMatrix:
(0, 0, 0)
(0, 0, 0)
(0, 0, 0)


const viewer = new Cesium.Viewer(“cesiumContainer”);

const time = Cesium.JulianDate.fromDate(new Date());
const fixedToInertialMatrix = new Cesium.Matrix3();
Cesium.Transforms.computeIcrfToFixedMatrix(time, fixedToInertialMatrix);

console.log('time: ’ + time);
console.log(‘fixedToInertialMatrix:’);
console.log(fixedToInertialMatrix);


Hi there,

The function is actually returning undefined because the necessary resources have not yet been loaded.

Instead, either continue polling this function until a value is returned, or manually preload the necessary data:

const interval = new Cesium.TimeInterval(...);
await Cesium.Transforms.preloadIcrfFixed(interval));
// the data is now loaded

Yeah…thanks. Got that part. This work locally. Question was why not sandcastle? I sometimes use SC to protype somethings. But…sometimes I need the EOP data. I had another post about this trying to load this data BUT there were CORS issues. Is SC just not capable of this? Was it intended to not have this feature avail in SC? Is there something I am missing at the top of a script to get SC to load that data? From what I understand there are data files generated locally ‘I think’ by AGI? Can those not be preloaded, etc?

Hi @bmcclint,

Can you clarify the issues you were having with Sandcastle? I was able to get you initial sample running: here’s a working Sandcastle.

The EOP data we have from AGI is shipped with CesiumJS. It should also be accessible from Sandcastle.