一个在场景中以等距矩形格式显示影像的
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 credit : Credit
获取全景图的版权信息。
获取全景图的源图像。
获取全景图的半径。
确定是否显示等距矩形全景图。
readonly transform : Matrix4
获取全景图的变换矩阵。
Methods
销毁此对象持有的 WebGL 资源。销毁对象可以实现 WebGL 资源的确定性
释放,而不是依赖垃圾回收器来销毁此对象。
对象一旦被销毁就不应再使用;调用除
对象一旦被销毁就不应再使用;调用除
isDestroyed 之外的任何函数都会导致 DeveloperError 异常。因此,
请将返回值(undefined)赋给该对象,如示例所示。
Throws:
-
DeveloperError :此对象已被销毁,即调用了 destroy()。
Example:
equirectangularPanorama = equirectangularPanorama && equirectangularPanorama.destroy();
See:
Returns:
如果此对象已被销毁则为
true,否则为 false。
Type Definitions
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> |
全景图的版权信息,显示在画布上。 |
