浏览代码

Merge pull request #17119 from lab101/dev

rawshader example: fixed naming and vertex count
Michael Herzog 6 年之前
父节点
当前提交
d3808533e8
共有 1 个文件被更改,包括 5 次插入3 次删除
  1. 5 3
      examples/webgl_buffergeometry_rawshader.html

+ 5 - 3
examples/webgl_buffergeometry_rawshader.html

@@ -81,20 +81,22 @@
 				scene.background = new THREE.Color( 0x101010 );
 
 				// geometry
-
-				var triangles = 500;
+				// nr of triangles with 3 vertices per triangle
+				var vertexCount = 200 * 3;
 
 				var geometry = new THREE.BufferGeometry();
 
 				var positions = [];
 				var colors = [];
 
-				for ( var i = 0; i < triangles; i ++ ) {
+				for ( var i = 0; i < vertexCount; i ++ ) {
 
+					// adding x,y,z
 					positions.push( Math.random() - 0.5 );
 					positions.push( Math.random() - 0.5 );
 					positions.push( Math.random() - 0.5 );
 
+					// adding r,g,b,a
 					colors.push( Math.random() * 255 );
 					colors.push( Math.random() * 255 );
 					colors.push( Math.random() * 255 );