1.782,1.782,36.098,0.986,2.314,36.098,1.629,3.821, 37.979,0.986,2.314,36.098,1.782,1.782,36.098,1.809 ,1.809,34.396,1.809,1.809,34.396,1.000,2.350,34.39 6,0.986,2.314,36.098,0.000,0.000,40.128,0.000,0.00 0,40.128,4.004,1.708,39.501,4.004,1.708,39.501,3.0 85,3.085,39.501,0.000,0.000,40.128,3.085,3.085,39. 501,4.004,1.708,39.501,3.821,1.629,37.979,3.821,1. 629,37.979,2.943,2.943,37.979,3.085,3.085,39.501,2 .943,2.943,37.979,3.821,1.629,37.979,2.314,0.986,3 6.098,2.314,0.986,36.098,1.782,1.782,36.098,2.943, 2.943,37.979,1.782,1.782,36.098,2.314,0.986,36.098 ,2.350,1.000,34.396,2.350,1.000,34.396,1.809,1.809 ,34.396,1.782,1.782,36.098,0.000,0.000,40.128,0.00 0,0.000,40.128,4.339,0.000,39.501,4.339,0.000,39.5 01,4.004,1.708,39.501,0.000,0.000,40.128,4.004,1.7 08,39.501,4.339,0.000,39.501,4.140,0.000,37.979,4. 140,0.000,37.979,3.821,1.629,37.979,4.004,1.708,39 .501,3.821,1.629,37.979,4.140,0.000,37.979,2.508,0 .000,36.098,2.508,0.000,36.098,2.314,0.986,36.098, 3.821,1.629,37.979,2.314,0.986,36.098,2.508,0.000, 36.098,2.548,0.000,34.396,2.548,0.000,34.396,2.350 ,1.000,34.396,2.314,0.986,36.098,2.548,0.000,34.39 6,2.350,-1.000,34.396,5.362,-2.281,33.261,5.362,-2.281,33.261,5.812,0.000,33.261,2.548,0.000,34.396 ,5.812,0.000,33.261,5.362,-2.281,33.261,9.695,-4.125,32.485,9.695,-4.125,32.485,10.510,0.000,32.485,5.812,0.000,33.26 1,10.510,0.000,32.485,9.695,-4.125,32.485,13.588,-5.781,31.709,13.588,-5.781,31.709,14.730,0.000,31.709,10.510,0.000,32.4 85,14.730,0.000,31.709,13.588,-5.781,31.709,15.278,-6.500,30.574,15.278,-6.500,30.574,16.561,0.000,30.574,14.730,0.000,31.7 09,2.350,-1.000,34.396,1.809,-1.809,34.396,4.127,-4.127,33.261,4.127,-4.127,33.261,5.362,-2.281,33.261,2.350,-1.000,34.396,5.362,-2.281,33.261,4.127,-4.127,33.261,7.462,-7.462,32.485,7.462,-7.462,32.485,9.695,-4.125,32.485,5.362,-2.281,33.261,9.695,-4.125,32.485,7.462,-7.462,32.485,10.458,-10.458,31.709,10.458,-10.458,31.709,13.588,-5.781,31.709,9.695,-4.125,32.485,13.588,-5.781,31.709,10.458,-10.458,31.709,11.758,-11.758,30.574,11.758,-11.758,30.574,15.278,-6.500,30.574,13.588,-5.781,31.709,1.809,-1.809,34.396,1.000,-2.350,34.396,2.281,-5.362,33.261,2.281,-5.362,33.261,4.127,-4.127,33.261,1.809,-1.809,34.396,4.127,-4.127,33.261,2.281,-5.362,33.261,4.125,-9.695,32.485,4.125,-9.695,32.485,7.462,-7.462,32.485,4.127,-4.127,33.261,7.462,-7.462,32.485,4.125,-9.695,32.485,5.781,-13.588,31.709,5.781,-13.588,31.709,10.458,-10.458,31.709,7.462,-7.462,32.485,10.458,-10.458,31.709,5.781,-13.588,31.709,6.500,-15.278,30.574,6.500,-15.278,30.574,11.758,-11.758,30.574,10.458,-10.458,31.709,1.000,-2.350,34.396,0.000,-2.548,34.396,0.000,-5.812,33.261,0.000,-5.812,33.261,2.281,-5.362,33.261,1.000,-2.350,34.396,2.281,-5.362,33.261,0.000,-5.812,33.261,0.000,-10.510,32.485,0.000,-10.510,32.485,4.125,-9.695,32.485,2.281,-5.362,33.261,4.125,-9.695,32.485,0.000,-10.510,32.485,0.000,-14.730,31.709,0.000,-14.730,31.709,5.781,-13.588,31.709,4.125,-9.695,32.485,5.781,-13.588,31.709,0.000,-14.730,31.709,0.000,-16.561,30.574,0.000,-16.561,30.574,6.500,-15.278,30.574,5.781,-13.588,31.709,0.000,-2.548,34.396,-1.000,-2.350,34.396,-2.281,-5.362,33.261,-2.281,-5.362,33.261,0.000,-5.812,33.261,0.000,-2.548,34.396,0.000,-5.812,33.261,-2.281,-5.362,33.261,-4.125,-9.695,32.485,-4.125,-9.695,32.485,0.000,-10.510,32.485,0.000,-5.812,33.261,0.000,-10.510,32.485,-4.125,-9.695,32.485,-5.781,-13.588,31.709,-5.781,-13.588,31.709,0.000,-14.730,31.709,0.000,-10.510,32.485,0.000,-14.730,31.709,-5.781,-13.588,31.709,-6.500,-15.278,30.574,-6.500,-15.278,30.574,0.000,-16.561,30.574,0.000,-14.730,31.709,-1.000,-2.350,34.396,-1.809,-1.809,34.396,-4.127,-4.127,33.261,-4.127,-4.127,33.261,-2.281,-5.362,33.261,-1.000,-2.350,34.396,-2.281,-5.362,33.261,-4.127,-4.127,33.261,-7.462,-7.462,32.485,-7.462,-7.462,32.485,-4.125,-9.695,32.485,-2.281,-5.362,33.261,-4.125,-9.695,32.485,-7.462,-7.462,32.485,-10.458,-10.458,31.709,-10.458,-10.458,31.709,-5.781,-13.588,31.709,-4.125,-9.695,32.485,-5.781,-13.588,31.709,-10.458,-10.458,31.709,-11.758,-11.758,30.574,-11.758,-11.758,30.574,-6.500,-15.278,30.574,-5.781,-13.588,31.709,-1.809,-1.809,34.396,-2.350,-1.000,34.396,-5.362,-2.281,33.261,-5.362,-2.281,33.261,-4.127,-4.127,33.261,-1.809,-1.809,34.396,-4.127,-4.127,33.261,-5.362,-2.281,33.261,-9.695,-4.125,32.485,-9.695,-4.125,32.485,-7.462,-7.462,32.485,-4.127,-4.127,0.851,0.201,0.486,0.851,0.145,0.350,0.925,0. 552,0.552,0.625,0.721,0.298,0.626,0.218,0.090,0.97 2,0.218,0.090,0.972,0.167,0.167,0.972,0.552,0.552, 0.625,0.167,0.167,0.972,0.218,0.090,0.972,0.160,0. 066,0.985,0.160,0.066,0.985,0.122,0.122,0.985,0.16 7,0.167,0.972,0.122,0.122,0.985,0.160,0.066,0.985, 0.350,0.145,0.925,0.350,0.145,0.925,0.268,0.268,0. 926,0.122,0.122,0.985,0.268,0.268,0.926,0.350,0.14 5,0.925,0.486,0.201,0.851,0.486,0.201,0.851,0.371, 0.371,0.851,0.268,0.268,0.926,0.721,0.298,0.626,0. 781,0.000,0.625,0.237,0.000,0.972,0.237,0.000,0.97 2,0.218,0.090,0.972,0.721,0.298,0.626,0.218,0.090, 0.972,0.237,0.000,0.972,0.173,0.000,0.985,0.173,0. 000,0.985,0.160,0.066,0.985,0.218,0.090,0.972,0.16 0,0.066,0.985,0.173,0.000,0.985,0.380,0.000,0.925, 0.380,0.000,0.925,0.350,0.145,0.925,0.160,0.066,0. 985,0.350,0.145,0.925,0.380,0.000,0.925,0.527,0.00 0,0.850,0.527,0.000,0.850,0.486,0.201,0.851,0.350, 0.145,0.925]);


gl.bufferData(gl.ARRAY_BUFFER, vertices2,gl.STATIC_DRAW);



//compile and link

var vertexShader1 = document.getElementById("vShaderCode");
var vertexShader = gl.createShader(gl.VERTEX_SHADER);
gl.shaderSource(vertexShader,vertexShader1.text);
gl.compileShader(vertexShader);


if(!gl.getShaderParameter(vertexShader,gl.COMPILE_ STATUS))
{
alert("Cant compile vertex shader");

gl.deleteShader(vertexShader);
return;
}


var fragmentShader1 = document.getElementById("fShaderCode");
var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);
gl.shaderSource(fragmentShader,fragmentShader1.tex t);
gl.compileShader(fragmentShader);

if(!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS))
{
alert("Could not compile fragment shader");

gl.deleteShader(fragmentShader);
return;
}




var shaderProgram = gl.createProgram();
gl.attachShader(shaderProgram,vertexShader);
gl.attachShader(shaderProgram,fragmentShader);


gl.linkProgram(shaderProgram);
if (!gl.getProgramParameter(shaderProgram,gl.LINK_STA TUS))
{
alert("Unable to initialise shaders");

gl.deleteProgram(shaderProgram);
gl.deleteProgram(vertexShader);
gl.deleteProgram(fragmentShader);
return;
}



gl.useProgram(shaderProgram);


var positionLocation = gl.getAttribLocation(shaderProgram, "aVertexPosition");
gl.enableVertexAttribArray(positionLocation);
gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer);


var colorLocation = gl.getAttribLocation(shaderProgram,"aVertexColor") ;
gl.enableVertexAttribArray(colorLocation);
gl.bindBuffer(gl.ARRAY_BUFFER,colorBuffer);


gl.vertexAttribPointer(positionLocation, 3, gl.FLOAT, false,0,0);
gl.vertexAttribPointer(colorLocation, 3, gl.FLOAT, true, 0,0);




gl.clearColor(0.0,0.0,0.0,1.0);
gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT);
gl.drawArrays(gl.TRIANGLES,0,3072);

gl.flush();


}
</script>
</head>
<body>
<canvas id="webGLCanvas" width="1000" height="700"></canvas>

</body>
</html>

[/code]