Cannot get 4th vector to render in WebGL TRIANGLE_STRIP -


i trying play around webgl , can render triangle in this plunker. try make full square changing...

//this... this.trianglevertexpositionbuffer.numitems = 3; // ... this.gl.drawarrays(this.gl.triangle_strip, 0, this.trianglevertexpositionbuffer.numitems); // this.. this.trianglevertexpositionbuffer.numitems = 4; 

this me should make square, however, triangle disappears. following warning...

gl error :gl_invalid_operation : gldrawarrays: attempt access out of range vertices in attribute 1 

what missing here?

you need add color attribute fourth vertex aswell.