包含将位置转换为各种参考框架的功能.

Methods

static Cesium.Transforms.computeFixedToIcrfMatrix(date, result)Matrix3|undefined

Computes a rotation matrix to transform a point or vector from the Earth-Fixed frame axes (ITRF) 用于国际天体参照框架 ( NT 0 / NT 1 ) 惯性框架轴 在一个特定的时间。 如果有必要的数据,此函数可能返回未定义 是否尚未装入转换.
Name Type Description
date JulianDate 计算旋转矩阵的时间 .
result Matrix3 optional 存储结果的对象 。 如果此参数是 未指定,创建并返回新实例.
Returns:
旋转矩阵,如果需要数据,则未定义 转换尚未加载.
Example:
// Transform a point from the Fixed axes to the ICRF axes.
const now = Cesium.JulianDate.now();
const pointInFixed = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
const fixedToIcrf = Cesium.Transforms.computeFixedToIcrfMatrix(now);
let pointInInertial = new Cesium.Cartesian3();
if (Cesium.defined(fixedToIcrf)) {
    pointInInertial = Cesium.Matrix3.multiplyByVector(fixedToIcrf, pointInFixed, pointInInertial);
}
See:

static Cesium.Transforms.computeIcrfToCentralBodyFixedMatrix(date, result)Matrix3|undefined

计算旋转矩阵以从国际天体转换点或矢量的默认函数 参考框架 ( GCRF / ICRF ) 惯性框架轴到中心体,一般是地球,特定时的固定框架轴 用于照明和从惯性参考框架转换的时间。 如果 转换所需的数据尚未装入.
Name Type Description
date JulianDate 计算旋转矩阵的时间 .
result Matrix3 optional 存储结果的对象 。 如果此参数是 未指定,创建并返回新实例.
Returns:
旋转矩阵,如果需要数据,则未定义 转换尚未加载.
Example:
// Set the default ICRF to fixed transformation to that of the Moon.
Cesium.Transforms.computeIcrfToCentralBodyFixedMatrix = Cesium.Transforms.computeIcrfToMoonFixedMatrix;
See:

static Cesium.Transforms.computeIcrfToFixedMatrix(date, result)Matrix3|undefined

计算旋转矩阵,从国际天体转换一个点或矢量 Reference Frame (GCRF/ICRF) inertial frame axes to the Earth-Fixed frame axes (ITRF) 在一个特定的时间。 如果有必要的数据,此函数可能返回未定义 是否尚未装入转换.
Name Type Description
date JulianDate 计算旋转矩阵的时间 .
result Matrix3 optional 存储结果的对象 。 如果此参数是 未指定,创建并返回新实例.
Returns:
旋转矩阵,如果需要数据,则未定义 转换尚未加载.
Example:
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);
  }
});
See:

static Cesium.Transforms.computeIcrfToMoonFixedMatrix(date, result)Matrix3

计算旋转矩阵,从国际天体转换一个点或矢量 参考框架 ( GCRF / ICRF ) 惯性框架轴对月球-变形框架轴 在一个特定的时间.
Name Type Description
date JulianDate 计算旋转矩阵的时间 .
result Matrix3 optional 存储结果的对象 。 如果此参数是 未指定,创建并返回新实例.
Returns:
旋转矩阵.
Example:
// Set the default ICRF to fixed transformation to that of the Moon.
Cesium.Transforms.computeIcrfToCentralBodyFixedMatrix = Cesium.Transforms.computeIcrfToMoonFixedMatrix;

static Cesium.Transforms.computeMoonFixedToIcrfMatrix(date, result)Matrix3

计算一个旋转矩阵,从月球形状框架轴中转换一个点或矢量 用于国际天体参照框架 ( NT 0 / NT 1 ) 惯性框架轴 在一个特定的时间.
Name Type Description
date JulianDate 计算旋转矩阵的时间 .
result Matrix3 optional 存储结果的对象 。 如果此参数是 未指定,创建并返回新实例.
Returns:
旋转矩阵.
Example:
// Transform a point from the Fixed axes to the ICRF axes.
const now = Cesium.JulianDate.now();
const pointInFixed = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
const fixedToIcrf = Cesium.Transforms.computeMoonFixedToIcrfMatrix(now);
let pointInInertial = new Cesium.Cartesian3();
if (Cesium.defined(fixedToIcrf)) {
    pointInInertial = Cesium.Matrix3.multiplyByVector(fixedToIcrf, pointInFixed, pointInInertial);
}

static Cesium.Transforms.computeTemeToPseudoFixedMatrix(date, result)Matrix3

计算旋转矩阵将点或矢量从 True Equinox ( NT 0 ) 轴转换为 某时伪修斧. 这种方法将 NT 0 时间标准视为等于 NT 1 .
Name Type Description
date JulianDate 计算旋转矩阵的时间 .
result Matrix3 optional 存储结果的对象 .
Returns:
如果未提供修改的结果参数或新的 NT% 0 实例 .
Example:
//Set the view to the inertial frame.
scene.postUpdate.addEventListener(function(scene, time) {
   const now = Cesium.JulianDate.now();
   const offset = Cesium.Matrix4.multiplyByPoint(camera.transform, camera.position, new Cesium.Cartesian3());
   const transform = Cesium.Matrix4.fromRotationTranslation(Cesium.Transforms.computeTemeToPseudoFixedMatrix(now));
   const inverseTransform = Cesium.Matrix4.inverseTransformation(transform, new Cesium.Matrix4());
   Cesium.Matrix4.multiplyByPoint(inverseTransform, offset, offset);
   camera.lookAtTransform(transform, offset);
});

static Cesium.Transforms.eastNorthUpToFixedFrame(origin, ellipsoid, result)Matrix4

从带有东向北轴的参考框架计算出一个 4x4 变换矩阵 中心位于所提供的椭圆形固定参考框架的源头. 地方轴被定义为:
  • The x axis points in the local east direction.
  • The y axis points in the local north direction.
  • The z axis points in the direction of the ellipsoid surface normal which passes through the position.
Name Type Default Description
origin Cartesian3 地方参考框架中心点.
ellipsoid Ellipsoid Ellipsoid.default optional The ellipsoid whose fixed frame is used in the transformation.
result Matrix4 optional 存储结果的对象 .
Returns:
如果未提供修改的结果参数或新的 NT% 0 实例 .
Example:
// Get the transform from local east-north-up at cartographic (0.0, 0.0) to Earth's fixed frame.
const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
const transform = Cesium.Transforms.eastNorthUpToFixedFrame(center);

static Cesium.Transforms.fixedFrameToHeadingPitchRoll(transform, ellipsoid, fixedFrameTransform, result)HeadingPitchRoll

计算特定参考框中从变换到的标题-pitch-roll角度. 向东转 正在向东增加正角的方向。 皮奇是当地东-北飞机的旋转. 正投球角度 are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.
Name Type Default Description
transform Matrix4 The transform
ellipsoid Ellipsoid Ellipsoid.default optional The ellipsoid whose fixed frame is used in the transformation.
fixedFrameTransform Transforms.LocalFrameToFixedFrame Transforms.eastNorthUpToFixedFrame optional A 4x4 transformation 从参考框架到所提供的椭圆形固定参考框架的矩阵
result HeadingPitchRoll optional 存储结果的对象 .
Returns:
没有提供修改的结果参数或新的标题PitchRoll实例 .

static Cesium.Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result)Quaternion

从一个参考框架计算出一个四角,其轴由标题-pitch-滚动角度计算 以原产地为中心。 向东转 正在向东增加正角的方向。 皮奇是当地东-北飞机的旋转. 正投球角度 are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.
Name Type Default Description
origin Cartesian3 地方参考框架中心点.
headingPitchRoll HeadingPitchRoll 方向,投球,并滚.
ellipsoid Ellipsoid Ellipsoid.default optional The ellipsoid whose fixed frame is used in the transformation.
fixedFrameTransform Transforms.LocalFrameToFixedFrame Transforms.eastNorthUpToFixedFrame optional A 4x4 transformation 从参考框架到所提供的椭圆形固定参考框架的矩阵
result Quaternion optional 存储结果的对象 .
Returns:
如果未提供修改的结果参数或新的 NT% 0 实例 .
Example:
// Get the quaternion from local heading-pitch-roll at cartographic (0.0, 0.0) to Earth's fixed frame.
const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
const heading = -Cesium.Math.PI_OVER_TWO;
const pitch = Cesium.Math.PI_OVER_FOUR;
const roll = 0.0;
const hpr = new HeadingPitchRoll(heading, pitch, roll);
const quaternion = Cesium.Transforms.headingPitchRollQuaternion(center, hpr);

static Cesium.Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result)Matrix4

从参考框架计算一个4x4变换矩阵,其轴由标题-pitch-roll角度计算 中心位于所提供的椭圆形固定参考框架的源头。 向东转 正在向东增加正角的方向。 皮奇是当地东-北飞机的旋转. 正投球角度 are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.
Name Type Default Description
origin Cartesian3 地方参考框架中心点.
headingPitchRoll HeadingPitchRoll 方向,投球,并滚.
ellipsoid Ellipsoid Ellipsoid.default optional The ellipsoid whose fixed frame is used in the transformation.
fixedFrameTransform Transforms.LocalFrameToFixedFrame Transforms.eastNorthUpToFixedFrame optional A 4x4 transformation 从参考框架到所提供的椭圆形固定参考框架的矩阵
result Matrix4 optional 存储结果的对象 .
Returns:
如果未提供修改的结果参数或新的 NT% 0 实例 .
Example:
// Get the transform from local heading-pitch-roll at cartographic (0.0, 0.0) to Earth's fixed frame.
const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
const heading = -Cesium.Math.PI_OVER_TWO;
const pitch = Cesium.Math.PI_OVER_FOUR;
const roll = 0.0;
const hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll);
const transform = Cesium.Transforms.headingPitchRollToFixedFrame(center, hpr);

static Cesium.Transforms.localFrameToFixedFrameGenerator(firstAxis, secondAxis)Transforms.LocalFrameToFixedFrame

生成一个从参考框架计算一个 4x4 变换矩阵的函数 中心位于所提供的椭圆形固定参考框架的源头.
Name Type Description
firstAxis string 本地参考框架第一轴的名称。 一定是这样 "东","北","上","西","南"或"下".
secondAxis string 本地参考框架第二轴的名称。 一定是这样 "东","北","上","西","南"或"下".
Returns:
计算 a 4x4 变换矩阵从参考框架,第一轴和第二轴符合参数,

static Cesium.Transforms.northEastDownToFixedFrame(origin, ellipsoid, result)Matrix4

从带有东北下轴的参考框架计算出一个 4x4 变换矩阵 中心位于所提供的椭圆形固定参考框架的源头. 地方轴被定义为:
  • The x axis points in the local north direction.
  • The y axis points in the local east direction.
  • The z axis points in the opposite direction of the ellipsoid surface normal which passes through the position.
Name Type Default Description
origin Cartesian3 地方参考框架中心点.
ellipsoid Ellipsoid Ellipsoid.default optional The ellipsoid whose fixed frame is used in the transformation.
result Matrix4 optional 存储结果的对象 .
Returns:
如果未提供修改的结果参数或新的 NT% 0 实例 .
Example:
// Get the transform from local north-east-down at cartographic (0.0, 0.0) to Earth's fixed frame.
const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
const transform = Cesium.Transforms.northEastDownToFixedFrame(center);

static Cesium.Transforms.northUpEastToFixedFrame(origin, ellipsoid, result)Matrix4

从带有东北轴的参考框架计算出一个 4x4 变换矩阵 中心位于所提供的椭圆形固定参考框架的源头. 地方轴被定义为:
  • The x axis points in the local north direction.
  • The y axis points in the direction of the ellipsoid surface normal which passes through the position.
  • The z axis points in the local east direction.
Name Type Default Description
origin Cartesian3 地方参考框架中心点.
ellipsoid Ellipsoid Ellipsoid.default optional The ellipsoid whose fixed frame is used in the transformation.
result Matrix4 optional 存储结果的对象 .
Returns:
如果未提供修改的结果参数或新的 NT% 0 实例 .
Example:
// Get the transform from local north-up-east at cartographic (0.0, 0.0) to Earth's fixed frame.
const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
const transform = Cesium.Transforms.northUpEastToFixedFrame(center);

static Cesium.Transforms.northWestUpToFixedFrame(origin, ellipsoid, result)Matrix4

从带有西北向上轴的参考框架计算出一个 4x4 变换矩阵 中心位于所提供的椭圆形固定参考框架的源头. 地方轴被定义为:
  • The x axis points in the local north direction.
  • The y axis points in the local west direction.
  • The z axis points in the direction of the ellipsoid surface normal which passes through the position.
Name Type Default Description
origin Cartesian3 地方参考框架中心点.
ellipsoid Ellipsoid Ellipsoid.default optional The ellipsoid whose fixed frame is used in the transformation.
result Matrix4 optional 存储结果的对象 .
Returns:
如果未提供修改的结果参数或新的 NT% 0 实例 .
Example:
// Get the transform from local north-West-Up at cartographic (0.0, 0.0) to Earth's fixed frame.
const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
const transform = Cesium.Transforms.northWestUpToFixedFrame(center);

static Cesium.Transforms.pointToWindowCoordinates(modelViewProjectionMatrix, viewportTransformation, point, result)Cartesian2

将一个点从模型坐标转换为窗口坐标.
Name Type Description
modelViewProjectionMatrix Matrix4 4x4模型-视图-投影矩阵.
viewportTransformation Matrix4 4×4景区变迁.
point Cartesian3 变之点.
result Cartesian2 optional 存储结果的对象 .
Returns:
如果未提供修改的结果参数或新的 NT% 0 实例 .

static Cesium.Transforms.preloadIcrfFixed(timeInterval)Promise.<void>

Preloads the data necessary to transform between the ICRF and Fixed axes, in either 方向,在一个特定间隔。 此函数返回一个承诺,当解决后, 表示预装完成.
Name Type Description
timeInterval TimeInterval 预装的间隔 .
Returns:
一个承诺,一旦解决, 表明预装完成 和对固定轴和 NT 0 轴之间变化的评估 不再在间隔内返回未定义的时间.
Example:
const interval = new Cesium.TimeInterval(...);
await Cesium.Transforms.preloadIcrfFixed(interval));
// the data is now loaded
See:

static Cesium.Transforms.rotationMatrixFromPositionVelocity(position, velocity, ellipsoid, result)Matrix3

将位置和速度转换为旋转矩阵.
Name Type Default Description
position Cartesian3 变化之位.
velocity Cartesian3 变速矢量.
ellipsoid Ellipsoid Ellipsoid.default optional The ellipsoid whose fixed frame is used in the transformation.
result Matrix3 optional 存储结果的对象 .
Returns:
如果未提供修改的结果参数或新的 NT% 0 实例 .

Type Definitions

Cesium.Transforms.LocalFrameToFixedFrame(origin, ellipsoid, result)Matrix4

从参考框架计算一个 4x4 变换矩阵 中心位于所提供的椭圆形固定参考框架的源头.
Name Type Default Description
origin Cartesian3 地方参考框架中心点.
ellipsoid Ellipsoid Ellipsoid.default optional The ellipsoid whose fixed frame is used in the transformation.
result Matrix4 optional 存储结果的对象 .
Returns:
如果未提供修改的结果参数或新的 NT% 0 实例 .
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.