Forums > Jitter to jit.matrix

May 30 2009 | 1:56 pm

According to the documentation of you can draw to a jit.matrix. But I cannot get it to work
I initialized my objects as;

window = new  JitterObject("jit.window", "draw_plane");
myrender = new  JitterObject("", "draw_plane");
back_draw = new JitterMatrix("matrix_render");

When I draw;

myrender.send("draw_pixels", new Atom[] { Atom.newAtom("matrix_render") });
sketch.setAttr("drawto", "matrix_render");
DrawColorSquare(vo1, vo2, vo3, vo4,1.0f,0.0f,0.0f);

If I change the line;
sketch.setAttr("drawto", "matrix_render");
sketch.setAttr("drawto", " draw_plane");
I can see the color square I am drawing
Can anyone give any advice on this?

May 30 2009 | 8:26 pm

I can’t provide the java code for you, but the ‘drawto’ message refers to the render context, which has to be the name of the window that you render to. matrix_render is the name you are providing for the jitter matrix that you want to draw your frame buffer into (I presume). The command that you need to provide to glsketch is something like ‘drawpixels matrix_render [matrix dims]’ whilst maintaining the context for your sketch object as draw_plane.

There is an example jitter patch using this method in the render to matrix examples, which might help clarify the steps and commands that you instruct to follow. I don’t remember the exact wording for the command to sketch so you’re best checking this out.

There’s also a java forum that might be of help to you, rather than asking here.


May 30 2009 | 8:33 pm

Oh, I’m sorry about that last reply, for some reason I didn’t get all of your message, and missed that you are already using the draw_pixels command. But anyway the I think the ‘drawto’ context part is still relevant.


May 30 2009 | 8:50 pm

Ahh, reading the full message correctly… or more accurately I think, I see you are making another error. You don’t send the draw pixels command to render but to sketch. So, something like

draw_pixels matrix_render;

should capture the frame buffer into the jit.matrix called matrix_render. You would then need to send the data from the jit.matrix to some processing chain and render it again to be able to see it. For example, capture the buffer, mess with the geometry, then render the result using sketch with a command like

drawmatrix ‘my_messed_up_geometry’;

I assume that you have created a in your code that is not visible? If not then you probably need to do so

mysketch = new JitterObject("jit.sketch", "draw_plane");

but I’m getting out of my depth trying to answer java questions. Again you might get more help from the java forum


Viewing 4 posts - 1 through 4 (of 4 total)

Forums > Jitter