|
@@ -124,14 +124,14 @@
|
|
|
|
|
|
geometry.addAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );
|
|
|
|
|
|
- var colors = new Float32Array( triangles * 3 * 4 );
|
|
|
+ var colors = new Uint8Array( triangles * 3 * 4 );
|
|
|
|
|
|
for ( var i = 0, l = triangles * 3 * 4; i < l; i += 4 ) {
|
|
|
|
|
|
- colors[ i ] = Math.random();
|
|
|
- colors[ i + 1 ] = Math.random();
|
|
|
- colors[ i + 2 ] = Math.random();
|
|
|
- colors[ i + 3 ] = Math.random();
|
|
|
+ colors[ i ] = Math.random() * 255;
|
|
|
+ colors[ i + 1 ] = Math.random() * 255;
|
|
|
+ colors[ i + 2 ] = Math.random() * 255;
|
|
|
+ colors[ i + 3 ] = Math.random() * 255;
|
|
|
|
|
|
}
|
|
|
|