In this lesson we cover setting up WebGL for use, including creating a canvas, getting the WebGL rendering context and clearing the canvas to a particular color. <!DOCTYPE html> <html lang="en"> <head> <meta charset="UT…
一.前言 根据前面一章的内容,继续第三章的学习. 二.正文 一起绘制三个点,这里要使用到缓存了 var n = initVertexBuffers(gl); //返回绘制点的个数 n ) { console.log('Failed to set the positions of the vertices'); return; } gl.clearColor(, , , ); gl.clear(gl.COLOR_BUFFER_BIT); gl.drawArrays(gl.POINTS,…