PrimitiveUtil.js代码
class PrimitiveUtil {
//画点(componentsPerPositionAttribute必须为3)
static addPrimitivePoints(viewer, pointPositionArr, componentsPerPositionAttribute, pointColorArr, componentsPerColorAttribute) {
let vertexShader = this.prototype.getVS();
let fragmentShader = this.prototype.getFS();
//顶点索引(坐标点下标的连接顺序)
let indicesTesm = [];
let pointNum = (pointPositionArr.length)/componentsPerPositionAttribute;
for (let i = 0; i < pointNum; i++) {
indicesTesm.push(i);
}
let positionArr = new Float64Array(pointPositionArr);
let colorArr = new Float32Array(pointColorArr);
let indiceArr = new Uint32Array(indicesTesm);
let geometry = this.prototype.createGeometry(Cesium.PrimitiveType.POINTS, positionArr, componentsPerPositionAttribute, colorArr, componentsPerColorAttribute, indiceArr);
let appearance = this.prototype.cr