|
@@ -520,21 +520,21 @@ onmessage = function (event) {
|
|
|
|
|
|
if(hasGS3D){//add
|
|
|
let buff2 = new ArrayBuffer(numPoints * 4 * 4);
|
|
|
- let buff3 = new ArrayBuffer(numPoints * 4 * 4);
|
|
|
+ let buff3 = new ArrayBuffer(numPoints * 4 * 3);
|
|
|
let centersInt = new Int32Array(buff2);
|
|
|
let centersFloat = new Float32Array(buff3);
|
|
|
for(let i=0;i<numPoints;i++){
|
|
|
- centersFloat[4 * i + 0] = positions[3 * i + 0] + pos[0]
|
|
|
- centersFloat[4 * i + 1] = positions[3 * i + 1] + pos[1]
|
|
|
- centersFloat[4 * i + 2] = positions[3 * i + 2] + pos[2]
|
|
|
- centersFloat[4 * i + 3] = 1;
|
|
|
- centersInt[4 * i + 0] = centersFloat[4 * i + 0] * 1000
|
|
|
- centersInt[4 * i + 1] = centersFloat[4 * i + 1] * 1000
|
|
|
- centersInt[4 * i + 2] = centersFloat[4 * i + 2] * 1000
|
|
|
+ centersFloat[3 * i + 0] = positions[3 * i + 0] + pos[0]
|
|
|
+ centersFloat[3 * i + 1] = positions[3 * i + 1] + pos[1]
|
|
|
+ centersFloat[3 * i + 2] = positions[3 * i + 2] + pos[2]
|
|
|
+ //centersFloat[4 * i + 3] = 1;
|
|
|
+ centersInt[4 * i + 0] = centersFloat[3 * i + 0] * 1000
|
|
|
+ centersInt[4 * i + 1] = centersFloat[3 * i + 1] * 1000
|
|
|
+ centersInt[4 * i + 2] = centersFloat[3 * i + 2] * 1000
|
|
|
centersInt[4 * i + 3] = 1000
|
|
|
}
|
|
|
attributeBuffers['centersInt'] = { buffer: buff2, attribute: pointAttribute };
|
|
|
- attributeBuffers['centersFloat'] = { buffer: buff3, attribute: pointAttribute }; //暂时必须4位,以后再改cpp改为3位
|
|
|
+ attributeBuffers['centersFloat'] = { buffer: buff3, attribute: pointAttribute };
|
|
|
}
|
|
|
|
|
|
} else if (pointAttribute.name === "rgba") {
|