EllipsoidSurfaceAppearance用于在Cesium地球上绘制表面椭球体。EllipsoidSurfaceAppearance可以用于绘制不同类型的椭球体地球,如球形或椭球形地球。
var viewer = new Cesium.Viewer("cesiumContainer");
// 创建椭球
var ellipsoid = new Cesium.Ellipsoid(6378137, 6378137, 6356752.3142451793);
// 创建EllipsoidSurfaceAppearance实例
var appearance = new Cesium.EllipsoidSurfaceAppearance({
aboveGround: true,
});
// 添加椭球到场景
var ellipsoidPrimitive = new Cesium.Primitive({
geometryInstances: new Cesium.GeometryInstance({
geometry: new Cesium.EllipsoidGeometry({
ellipsoid: ellipsoid,
vertexFormat: Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,
}),
}),
appearance: appearance,
});
viewer.scene.primitives.add(ellipsoidPrimitive);