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

Peter Castine's icon

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.

Max Patch
Copy patch and select New From Clipboard in Max.

Hopefully one of the Jitter gurus is reading.

timtom's icon
Max Patch
Copy patch and select New From Clipboard in Max.

if you define tester as rendercontext for the text2d and the gridshape, it seems to work.

Peter Castine's icon

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.

diablodale's icon

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.