Javascript how to reference the whole matrix?

centre ville's icon

Hi,

In gen we can reference the whole matrix and work on this as a whole. I notice in the javascript docs that we only have getcell and setcell methods. I'm wondering then how is it possible to work on the whole matrix like jit.gl.pix does?

Floating Point's icon

probably to do with jit.gl.pix using gl commands, whereas matrix operations, which is what the js api is accessing, do not use gl commands

tmhglnd's icon

jit.gl.pix works on textures, not matrices (input matrices will be converted to textures). Working with matrices requires jit.pix or jit.gen. The difference is working on the gpu or working on the cpu. For matrix operations in JS, see the jitter in javascript tutorials 45,46,47, there the use of the .matrixcalc() method is explained, a function that is used to process a jit.matrix.