Some confusion about Qt Canvas3D
I'm using Qt Canvas3D module to draw a 3D scene,
when I use
var size = 1024; gl.bindBuffer(gl.ARRAY_BUFFER, mybuffer) ; gl.bufferData(gl.ARRAY_BUFFER, 4*size, gl.DYNAMIC_DRAW); gl.bufferSubData(gl.ARRAY_BUFFER, offset, myArrayData);
this segment of code works well.
but when I set the variable
sizeto 8192 or larger, it will be something wrong and show me a very strange graphics, and then it won't show ever.
But sometimes, I set
sizeto 8192, it may work as my expectation. I don't know what's wrong with the code.
Is my offset wrong or the the function
bufferData(glEnums target, long size, glEnums usage)I use wrong?
and if I use a
new Float32Array()as the second argument, it will work very normally, but I dont know how to add more vertices into the buffer, can anyone help me?