提交 e222d48a 编写于 作者: M Mr.doob

Added Uint8Array case to webgl_buffergeometry_rawshader.

上级 145f9e2a
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册