EquirectangularPanorama

new Cesium.EquirectangularPanorama(options)

一个在场景中以等距矩形格式显示影像的 Panorama
Name Type Description
options EquirectangularPanorama.ConstructorOptions 描述初始化选项的对象
Example:
const position = Cesium.Cartesian3.fromDegrees(
  -75.1699,  // longitude
  39.9522,   // latitude
  100.0      // height in meters
);

const heading = Cesium.Math.toRadians(45.0); // rotation about up axis
const pitch = Cesium.Math.toRadians(-30.0);   // pitch (negative looks down)
const roll = Cesium.Math.toRadians(10.0);    // roll about forward axis

const hpr = new Cesium.HeadingPitchRoll(
  heading,
  pitch,
  roll
);

const modelMatrix = Cesium.Transforms.headingPitchRollToFixedFrame(
  position,
  hpr,
  Cesium.Ellipsoid.WGS84,
  Cesium.Transforms.eastNorthUpToFixedFrame
);

scene.primitives.add(new Cesium.EquirectangularPanorama({
  transform: modelMatrix,
  image: 'path/to/image',
}));
Demo:

Members

获取全景图的版权信息。

readonly image : string|HTMLImageElement|HTMLCanvasElement|ImageBitmap

获取全景图的源图像。
获取全景图的半径。
确定是否显示等距矩形全景图。
获取全景图的变换矩阵。

Methods

销毁此对象持有的 WebGL 资源。销毁对象可以实现 WebGL 资源的确定性 释放,而不是依赖垃圾回收器来销毁此对象。

对象一旦被销毁就不应再使用;调用除 isDestroyed 之外的任何函数都会导致 DeveloperError 异常。因此, 请将返回值(undefined)赋给该对象,如示例所示。
Throws:
Example:
equirectangularPanorama = equirectangularPanorama && equirectangularPanorama.destroy();
See:
如果此对象已被销毁则返回 true,否则返回 false。

如果此对象已被销毁,则不应再使用它;调用除 isDestroyed 之外的任何函数都会导致 DeveloperError 异常。
Returns:
如果此对象已被销毁则为 true,否则为 false
See:
ViewerCesiumWidget 渲染场景以获取渲染此图元 所需的绘制命令时调用。

请勿直接调用此函数。此处记录它只是 为了列出渲染场景时可能传播出的异常:

Type Definitions

Cesium.EquirectangularPanorama.ConstructorOptions

EquirectangularPanorama 构造函数的初始化选项
Properties:
Name Type Attributes Default Description
options.transform Matrix4 定义一个 4x4 变换矩阵,用于确定全景图的位置和朝向 (例如,由位置和航向-俯仰-滚转推导得出)。
options.image string | HTMLImageElement | HTMLCanvasElement | ImageBitmap 指向图像资源的 URL,或预加载的图像对象。
options.radius number <optional>
100000.0 全景图的半径,单位为米。
options.repeatHorizontal number <optional>
1.0 纹理在水平方向重复的次数。
options.repeatVertical number <optional>
1.0 纹理在垂直方向重复的次数。
options.credit Credit | string <optional>
全景图的版权信息,显示在画布上。
需要帮助?获取答案的最快方式是在 Cesium 论坛 上向社区和团队提问。