在supermap for webGL 2023 中,采用前端js自定义水面区域,并设置水纹,在原生Cesium1.81代码里面,水纹正常,使用SuperMap iClient3D 11i (2023) beta for Cesium,水纹错乱,水纹实现代码如下:
function applyWaterMaterial(primitive, scene) {
primitive.appearance.material = new Cesium.Material({
fabric: {
type: 'Water',
uniforms: {
baseWaterColor: new Cesium.Color(64 / 255.0, 157 / 255.0, 253 / 255.0, 0.5),
normalMap: "images/waterNormals.jpg",
frequency: 1000.0,
animationSpeed: 0.01,
amplitude: 10,
specularIntensity: 10
}
}
});
}
var worldRectangle = viewer.scene.primitives.add(new Cesium.Primitive({
geometryInstances : new Cesium.GeometryInstance({
geometry : new Cesium.PolygonGeometry({
polygonHierarchy : new Cesium.PolygonHierarchy(
Cesium.Cartesian3.fromDegreesArray([114.2782783691, 30.5551370447,
114.2849717217, 30.5664644888, 114.2933813186, 30.5782210028, 114.3054808407, 30.5974433323,
114.3141478742, 30.6087707764, 114.3191249826, 30.6176954294, 114.3327691245, 30.6106586838,
114.3254750863, 30.6028496124, 114.3210986635, 30.5977865882, 114.3178377994, 30.5936675176,
114.3183526726, 30.592380308, 114.309256578, 30.5809670499, 114.3066822116, 30.5758182116,
114.3001604834, 30.5662070469, 114.2952691873, 30.5609723947, 114.2914934499, 30.5566816962,
114.2874602759, 30.5490442528, 114.2782783691, 30.5551370447
])
),
vertexFormat : Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,
height:3
})
}),
appearance: new Cesium.EllipsoidSurfaceAppearance({
aboveGround: true
}),
show: true
}));
applyWaterMaterial(worldRectangle, scene);
水纹素材下载地址为:
链接:https://pan.baidu.com/s/101iNzfPXIf4k952YI-FfHw
提取码:ilbq
不知道是什么原因导致的。。。。。。。