ft bozo but in 3D
This commit is contained in:
20
frontend/static/js/3D/buffers.js
Normal file
20
frontend/static/js/3D/buffers.js
Normal 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 };
|
Reference in New Issue
Block a user