javascript null class pointer creating jit.gl.text3d


    Mar 14 2019 | 9:36 pm
    Hey folks, I am trying to create some gl objects from javascript. I seem to be able to create a "jit.gl.gridshape" with no problem. But when I try to create a "jit.gl.text3d", I get the following error:
    jsjitterobject_Constructor: null class pointer jit_gl_text3d
    Is there any reason why I would not be able to create this object?

    • Mar 14 2019 | 11:30 pm
      create a "jit.gl.text" and set the "mode" attribute to "3d"
    • Mar 15 2019 | 4:48 pm
      Ahhh I see, got it. It is working now. Thanks!
    • Mar 15 2019 | 5:48 pm
      Another quick question...
      I am trying to send a message to "jit.gl.text" to set the text. Here is my code...
      var gridShapeLabel = new JitterObject("jit.gl.text", context); gridShapeLabel.message("text", "Test");
      I get the following error: js: testcode.js: Javascript TypeError: gridShapeLabel.message is not a function, line 79 Is there something I am missing here? What is the best practice for sending a jitter object a message?
    • Mar 18 2019 | 3:27 pm
      Any ideas?
    • Mar 18 2019 | 4:46 pm
      gridShapeLabel.text("Test");
    • Mar 21 2019 | 3:15 am
      Okay I am slowly getting there, thanks for your help. I have an example patch where I define a jit.gl.render where I am trying to add some jit.gl.text from javascript. Here is my test patch and code. Is there any reason why my text is not showing up?
      autowatch = 1;
      // variables var renderer; var context = "journey-ctx"
      ////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////
      function findObj(objname) { var obj = this.patcher.firstobject; while(obj != null) { if(obj.varname == objname) return obj;
      nextobj = obj.nextobject; if(obj == nextobj ) break; else obj = nextobj ; } return null; }
      function bang() { renderer = findObj("theRenderer"); if(renderer == null){ post("Error: could not find renderer"); return; }
      var gridShapeLabel = new JitterObject("jit.gl.text", context); gridShapeLabel.text = "some text"; gridShapeLabel.gl_color = "1. 1. 1. 1."; gridShapeLabel.align = 1; gridShapeLabel.fontsize = 20; gridShapeLabel.mode = "3d";
      post("creating text");
      }
    • Mar 24 2019 | 3:16 pm
      Any one have an idea what I may be missing?
    • Mar 25 2019 | 4:33 pm
      your syntax on the text message is still incorrect. compare it to what i posted in my last reply.
      you also need to set array attributes with arrays, not strings, e.g. gridShapeLabel.gl_color = [1, 1, 1, 1];
    • Mar 26 2019 | 12:59 am
      Okay got it now. Thanks!