jit.fill using js / a little help please
Hi list, I'm trying to use the following js:
mymatrix = new JitterMatrix (1,"char",ncols, nrows);
myfill = new JitterObject("jit.fill", mymatrix, 0);
I tried some alternative arguments too, but I keep getting the following
error:
"jsjitterobject_Contructor: null class pointer jit_fill"
What am I doing wrong? Also I can't find any reference on jitter js. Are
there docs besides the tutorials and regular max js reference? I have a hard
time figuring out the different messages. For example, how do I send a list
to jit.fill?
is "myfill(array[])" going to work?
Thijs
I don't think you can use jit.fill in JS. You can do it yourself
however. Try something like
myMatrix.setcell(cellCoords[], "val", vals[]);
wes
jit.fill can't be instantiated in JS at this time.
jb
Thanks for the replies. I'll work with setcell then. Tying it out led me to
another problem. Basically I read textlines (file.readline()) from a file
into the array "textlines[]" then I need to convert the strings to ascii.
This ascii is then read into a 1-plane char jit.matrix for later use with
text3d. I can't figure out how to convert to ascii properly. This is what I
have:
for(var i=1; i
{
var ascii = new Array();
var textline = textlines[i+1];
for (var k=0; k
{
ascii[k] = textline.charCodeAt(k);
}
mymatrix.setcell([0, i], "val", ascii);
}
Am I doing something stupid here? Is there maybe a (more efficient) way to
read ascii straigth from the textfile? The charCodeAt() was the only
function I could find to convert a string.