original:
https://blog.csdn.net/qq_31709249/article/details/81303291
Use Picture
Achieve results:
The principle:
primitive water + surface material
Whereby demo can learn the method for manufacturing a dynamic material
uniform parameters:
There are many original redundant code, remove easily see the core
//河道关键点数组
var River1Point =[
115.5985634205044,32.43079913513041,
116.5985634205044,32.43079913513041,
116.5985634205044,33.43079913513041,
115.5985634205044,33.43079913513041,
];
//河道1多边形
var polygon1 = new Cesium.PolygonGeometry({
polygonHierarchy : new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(River1Point)),
extrudedHeight:0,
height:0,
vertexFormat : Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT
});
var River1=new Cesium.Primitive({
geometryInstances : new Cesium.GeometryInstance({
geometry :polygon1
}),
appearance : new Cesium.EllipsoidSurfaceAppearance({
aboveGround : true
}),
show : true
});
var River1_Material =new Cesium.Material({
fabric : {
type : 'Water',
uniforms : {
normalMap:'./waterNormals.jpg',
frequency: 100.0,
animationSpeed: 0.01,
amplitude: 10.0
}
}
});
var scene = viewer.scene;
River1.appearance.material = River1_Material;
scene.primitives.add(River1); //添加到场景
viewer.camera.setView({
destination: Cesium.Cartesian3.fromDegrees( 115.5985634205044,32.43079913513041, 300000)
});