Created
August 25, 2019 02:13
-
-
Save kenjiSpecial/4c04eb4d8e2e826153bf286f5450032f to your computer and use it in GitHub Desktop.
rendering simple plane
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gl.useProgram(program) | |
gl.bindBuffer(gl.ARRAY_BUFFER, gl.createBuffer()); | |
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ -1,-1, 1,-1, -1, 1, 1, 1]), gl.STATIC_DRAW); | |
var positionLocation = gl.getAttribLocation(program, "position"); | |
gl.enableVertexAttribArray(positionLocation); | |
gl.vertexAttribPointer(positionLocation, 2, gl.FLOAT, false, 0, 0); | |
gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment