-
I didn't know discussions exist in Github. I'm trying to create a This one works: const arrays = {
position: {numComponents:2, data: [
0, 0,
10, 10,
0, 10,
]},
indices: [
0, 1, 2,
]
};
const bufferInfo = twgl.createBufferInfoFromArrays(gl, arrays); Passing empty array, const arrays = {
position: {numComponents:2, data: []},
indices: []
};
const bufferInfo = twgl.createBufferInfoFromArrays(gl, arrays);
// .. later in the code, during render
twgl.setAttribInfoBufferFromArray(
gl,
bufferInfo.attribs.position,
new Float32Array([tri[0], tri[1], tri[2], tri[3], tri[4], tri[5]])
); I don't see anything getting rendererd. QUESTION: Is this valid approach? Or is there a way to setup buffer info during initialization phase. Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
greggman
Jul 4, 2022
Replies: 1 comment 1 reply
-
It's not really clear what you're trying to do. For now you could do this
twgl does not provide a way to update indices. For that you'll have to use raw WebGL. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Vadi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's not really clear what you're trying to do. For now you could do this
twgl does not provide a way to update indices. For that you'll have to use raw WebGL.