2
0
Эх сурвалжийг харах

rawshader example: fixed naming and vertex count

Kris Meeusen 6 жил өмнө
parent
commit
dfe247ccf8

+ 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 );