title: Where should i edit to draw two triangles in webGL (with html, Javascript)
body: <p>This below is my code.
  I want to show two triangles, but it always only show just one triangle.
  Where should i edit and how to edit..? (can you tell me like axx (x) -&gt; ayy (o) ? )</p>
  <p>I have already tried about it more than 4 or 5 hours... but result is disappointing to me.
  Please tell me where should i edit...</p>
  <pre><code>var gl;
  var points;
  
  window.onload = function init()
  {
      var canvas = document.getElementById( &quot;gl-canvas&quot; );
  
      gl = WebGLUtils.setupWebGL( canvas );
      if ( !gl ) { alert( &quot;WebGL isn't available&quot; ); }
  
  
      //var vertices = new Float32Array([vec2(-1, -1), vec2(-0.5, 1), vec2(0, -1), [vec2(0, -1), vec2(0.5, 1), vec2(1, -1)]);
      var vertices = [ vec2(-1.0,-1.0), vec2(-0.5,1.0), vec2(0.0,-1.0), vec2(0.0, -1.0), vec2(0.5, 1.0), vec2(1.0, -1.0)];
      // var vertices_02 = [ vec2(0.0, -1.0), vec2(0.5, 1.0), vec2(1.0, -1.0)];
      //  Configure WebGL
  
      gl.viewport( 0, 0, canvas.width, canvas.height );
      gl.clearColor( 0.0, 0.0, 0.0, 1.0 );
  
      //  Load shaders and initialize attribute buffers
  
      var program = initShaders( gl, &quot;vertex-shader&quot;, &quot;fragment-shader&quot; );
      gl.useProgram( program );
  
      // Load the data into the GPU
  
      var bufferId = gl.createBuffer();
      gl.bindBuffer( gl.ARRAY_BUFFER, bufferId );
      gl.bufferData( gl.ARRAY_BUFFER, flatten(vertices), gl.STATIC_DRAW );
  
  
      // Associate vertex data buffer with shader variables
  
      var vPosition = gl.getAttribLocation( program, &quot;vPosition&quot; );
      gl.vertexAttribPointer( vPosition, 2, gl.FLOAT, false, 0, 0 );
      gl.enableVertexAttribArray( vPosition );
  
      render();
  };
  
  
  function render() {
      gl.clear( gl.COLOR_BUFFER_BIT );
      gl.drawArrays( gl.TRIANGLES, 0, 6 );
  }
  </code></pre>