ft bozo but in 3D

This commit is contained in:
Kbz-8
2024-01-23 16:37:01 +01:00
parent ee0c1ed90d
commit c6455b6935
5 changed files with 213 additions and 1 deletions

View File

@ -0,0 +1,20 @@
function initBuffers(gl)
{
const positionBuffer = initPositionBuffer(gl);
return { position: positionBuffer };
}
function initPositionBuffer(gl)
{
const positionBuffer = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);
const positions = [1.0, 1.0, -1.0, 1.0, 1.0, -1.0, -1.0, -1.0];
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(positions), gl.STATIC_DRAW);
return positionBuffer;
}
export { initBuffers };