English中文

EquirectangularPanorama

new Cesium.EquirectangularPanorama(options)

A Panorama 在场景中以等距柱状投影格式显示图像。 that displays imagery in equirectangular format in a scene.
名称 Name 类型 Type 说明 Description
options EquirectangularPanorama.ConstructorOptions 描述初始化选项的对象 Object describing initialization options
示例: 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

获取全景图的学分。 Gets the credits of the panorama.

readonly image : string|HTMLImageElement|HTMLCanvasElement|ImageBitmap

获取全景图的源图像。 Gets the source image of the panorama.
获取全景图的半径。 Gets the radius of the panorama.
确定是否显示等距柱状全景图。 Determines if the equirectangular panorama will be shown.
获取全景图的变换。 Gets the transform of the panorama.

方法 Methods

销毁该对象持有的 WebGL 资源。销毁对象可以确定性地释放 WebGL 资源,而不是依赖垃圾收集器来销毁该对象。 Destroys the WebGL resources held by this object. Destroying an object allows for deterministic release of WebGL resources, instead of relying on the garbage collector to destroy this object.

一旦对象被销毁,就不应再使用;调用除 Once an object is destroyed, it should not be used; calling any function other than isDestroyed 将导致 will result in a DeveloperError 例外。因此,分配返回值( exception. Therefore, assign the return value (undefined) 到对象,如示例中所做的那样。 ) to the object as done in the example.
抛出: Throws:
  • DeveloperError : This object was destroyed, i.e., destroy() was called.
示例: Example:
equirectangularPanorama = equirectangularPanorama && equirectangularPanorama.destroy();
另见: See:
如果该对象被销毁则返回 true;否则为假。 Returns true if this object was destroyed; otherwise, false.

如果该对象被破坏,则不应使用它;调用除 If this object was destroyed, it should not be used; calling any function other than isDestroyed 将导致 will result in a DeveloperError exception.
返回: Returns:
true 如果该物体被摧毁;否则, if this object was destroyed; otherwise, false.
另见: See:
调用时间 Called when Viewer or CesiumWidget 渲染场景以获取渲染此图元所需的绘制命令。 render the scene to get the draw commands needed to render this primitive.

不要直接调用该函数。记录此内容只是为了列出渲染场景时可能传播的异常: Do not call this function directly. This is documented just to list the exceptions that may be propagated when the scene is rendered:

类型定义 Type Definitions

Cesium.EquirectangularPanorama.ConstructorOptions

EquirectangularPanorama 构造函数的初始化选项 Initialization options for the EquirectangularPanorama constructor
属性: Properties:
名称 Name 类型 Type Attributes 默认值 Default 说明 Description
options.transform Matrix4 定义全景图位置和方向的 4x4 变换矩阵(例如,从位置和航向俯仰滚动导出)。 A 4x4 transformation matrix that defines the panorama’s position and orientation (for example, derived from a position and heading-pitch-roll).
options.image string | HTMLImageElement | HTMLCanvasElement | ImageBitmap 图像资源或预加载图像对象的 URL。 A URL to an image resource, or a preloaded image object.
options.radius number <可选> &lt;optional>
100000.0 全景图的半径(以米为单位)。 The radius of the panorama in meters.
options.repeatHorizontal number <可选> &lt;optional>
1.0 水平重复纹理的次数。 The number of times to repeat the texture horizontally.
options.repeatVertical number <可选> &lt;optional>
1.0 垂直重复纹理的次数。 The number of times to repeat the texture vertically.
options.credit Credit | string <可选> &lt;optional>
显示在画布上的全景图的版权。 A credit for the panorama, which is displayed on the canvas.
需要帮助吗?获得答案的最快方法是从社区和团队那里获得答案 Need help? The fastest way to get answers is from the community and team on the Cesium Forum.