jit.gl.sketch + drawobject + jit.gl.text2d ?= no joy


    Aug 31 2011 | 9:38 am
    I'm trying to embed text into a scene generated with a jit.gl.sketch object. The patch below is a very stripped-down version of what I'm trying to do, but it doesn't work here, either.
    What's wrong with the patch?
    If there is another way of getting jit.gl.sketch to render text, that would also be good to know.
    Hopefully one of the Jitter gurus is reading.

    • Aug 31 2011 | 10:00 am
      if you define tester as rendercontext for the text2d and the gridshape, it seems to work.
    • Aug 31 2011 | 1:25 pm
      Indeed! Thank you very much -- I've been banging my head against this for a while.
      My confusion was caused by the fact that in the example of using drawobject in the jit.gl.sketch.maxhelp, the relevant object wasn't set to the final render context. (Cf. [p object_commands] in the maxhelp file). I'm not sure why text2d behaves differently from other jit.gl.* objects.
      It would be nice to have a bit more documentation on around here. Not all the messages to jit.gl.sketch seem to be documented, and some of the documentation is on the sparse side. Or maybe I'm missing something.
    • Nov 20 2011 | 12:23 am
      A caution here. It is true that putting the rendering context will make those the text and torus render. However, that would occur without having the sketch. Why?
      Because your two objects will automatically render when the gl render gets a bang. You're likely causing the text and torus to be drawn twice. If you want it to be drawn and controlled by the sketch (not the automatic render), then you need to set @automatic 0 on both the text and torus.