提交 dfe247cc 编写于 作者: K Kris Meeusen

rawshader example: fixed naming and vertex count

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