Skip to content

KBE3D / KBCore / Cesium / Transforms / computeIcrfToFixedMatrix

函数: computeIcrfToFixedMatrix()

computeIcrfToFixedMatrix(date: JulianDate, result?: Matrix3): Matrix3 | undefined

Computes a rotation matrix to transform a point or vector from the International Celestial Reference Frame (GCRF/ICRF) inertial frame axes to the Earth-Fixed frame axes (ITRF) at a given time. This function may return undefined if the data necessary to do the transformation is not yet loaded.

参数

date

JulianDate

The time at which to compute the rotation matrix.

result?

Matrix3

The object onto which to store the result. If this parameter is not specified, a new instance is created and returned.

返回

Matrix3 | undefined

The rotation matrix, or undefined if the data necessary to do the transformation is not yet loaded.

示例

ts
scene.postUpdate.addEventListener(function(scene, time) {
  // View in ICRF.
  const icrfToFixed = Cesium.Transforms.computeIcrfToFixedMatrix(time);
  if (Cesium.defined(icrfToFixed)) {
    const offset = Cesium.Cartesian3.clone(camera.position);
    const transform = Cesium.Matrix4.fromRotationTranslation(icrfToFixed);
    camera.lookAtTransform(transform, offset);
  }
});

KBE3D @3.0.0 Copyright © 2024-present KBE3D