首页 / 浏览问题 / 三维GIS / 问题详情
限高分析primitives无法贴倾斜模型
33EXP 2024年09月04日

相关代码如下,只能在地图上看到,加了倾斜模型就不行,clampToS3M、classificationType设置无效

let color = Cesium.Color.fromCssColorString("#FF0000").withAlpha(0.8);
          let height = 0;
          window.viewer.scene.primitives.add(
            new Cesium.ClassificationPrimitive({
              geometryInstances: new Cesium.GeometryInstance({
                geometry: new Cesium.PolygonGeometry({
                  polygonHierarchy: new Cesium.PolygonHierarchy(
                    Cesium.Cartesian3.fromDegreesArray(ptArr)
                  ),
                  height,
                  extrudedHeight: height + 5000
                }),
                attributes: {
                  color: Cesium.ColorGeometryInstanceAttribute.fromColor(color),
                }
              }),
              releaseGeometryInstances: false,
              // clampToS3M: true,
              // classificationType: Cesium.ClassificationType.S3M_TILE,
              // classificationType: Cesium.ClassificationType.BOTH,
            }));

1个回答

您好,想要让对象贴在倾斜表面,建议您使用entity实体,比如

                viewer.entities.add({
                    id: 'identify-area',
                    name: '面',
                    polygon: {
                        hierarchy: SuperMap3D.Cartesian3.fromDegreesArray(lonLatArr),
                        material: new SuperMap3D.Color(1.0, 0.0, 0.0, 0.3),
                        classificationType: SuperMap3D.ClassificationType.S3M_TILE // 贴在S3M模型表面
                    },
                });

希望可以帮助到您。
10,538EXP 2024年09月04日
...