jit.fill using js / a little help please

    Mar 06 2006 | 11:17 pm
    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?

    • Mar 06 2006 | 11:23 pm
      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[]);
    • Mar 07 2006 | 9:28 am
      jit.fill can't be instantiated in JS at this time.
    • Mar 07 2006 | 10:15 am
      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.