EquirectangularPanorama

new Cesium.EquirectangularPanorama(options)

A Panorama that displays imagery in equirectangular format in a scene.
参数名称 类型 描述信息
options EquirectangularPanorama.ConstructorOptions Object describing initialization options
使用示例:
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:

成员(属性)

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.

方法

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.
使用示例:
equirectangularPanorama = equirectangularPanorama && equirectangularPanorama.destroy();
参考:
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.
返回值:
true if this object was destroyed; otherwise, false.
参考:
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:

定义的类型

Cesium.EquirectangularPanorama.ConstructorOptions

Initialization options for the EquirectangularPanorama constructor
属性:
属性名称 类型 可选 默认值 描述信息
options.transform Matrix4 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 A URL to an image resource, or a preloaded image object.
options.radius number <可选>
100000.0 The radius of the panorama in meters.
options.repeatHorizontal number <可选>
1.0 The number of times to repeat the texture horizontally.
options.repeatVertical number <可选>
1.0 The number of times to repeat the texture vertically.
options.credit Credit | string <可选>
A credit for the panorama, which is displayed on the canvas.