"draw" message to jit.gl.text3d via JS?


    Jul 17 2008 | 7:52 pm
    Hi. I'm working on an iterative text thing in javascript, and I would like to use a single jit.gl.text3d object @automatic 0 to draw hundreds of words to a texture and then pass it to the renderer when I'm done.
    Before I get to all of the texture business, I can't seem to pass a "draw" message to my text3d object via javascript. (works fine in the MAX GUI)
    Here is a simplified js and patch to demonstrate (max 4.6):
    ---------------------
    SAVE AS testscript.js
    ---------------------
    outlets = 1;
    var mycontext = jsarguments[1]; // the render context
    function bang() {
    outlet (0, "erase") // to renderer
    // our humble object
    text3dInstance = new JitterObject("jit.gl.text3d",mycontext);
    text3dInstance.automatic = 0;
    text3dInstance.align = 1;
    text3dInstance.depth = 0;
    text3dInstance.scale = [.2, .2, 1];
    text3dInstance.position = [0, 0, 1];
    text3dInstance.text("Where");
    text3dInstance.draw(); // doesn't seem to be drawing?
    text3dInstance.position = [0, -0.2, 1];
    text3dInstance.text("Am I?");
    text3dInstance.draw(); // doesn't seem to be drawing?
    outlet (0, "bang") // to renderer
    killme();
    }
    function killme() {
    if (text3dInstance) {
    text3dInstance.freepeer();
    }
    }
    ---------------------
    The patch
    ---------------------
    max v2;