Explorar o código

Merge pull request #17119 from lab101/dev

rawshader example: fixed naming and vertex count
Michael Herzog %!s(int64=6) %!d(string=hai) anos
pai
achega
d3808533e8
Modificáronse 1 ficheiros con 5 adicións e 3 borrados
  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 );