gl.multiple color matrix problem with gl.sketch

Jan 25, 2011 at 1:22am

gl.multiple color matrix problem with gl.sketch

hi…

im trying to change colors using the color matrix glparam of a gl.multiple that have associated a gl.sketch and theres no way to do it… but this works fine if i change to a gl.gridshape object…

theres any special consideration i should have to do it with a sketch object?

thank you very much!
best!

– Pasted Max Patch, click to expand. –
#54579
Jan 27, 2011 at 7:42pm

This isn’t possible, since jit.gl.sketch works differently than a single object. I would use Javascript, or poly, or jit.gl.sketch itself for rendering multiple instances of another jit.gl.sketch.

#196558
Nov 20, 2011 at 10:13am

Sorry to bump this. Is there anyway to use roundedplane in gl.multiple? Because seems only gl.sketch has the roundedplane command.

#196559
Nov 21, 2011 at 12:31am

you can can use gl.multiple and gl.sketch together, you just can’t use @glparam color with the multiple.

#196560
Nov 23, 2011 at 10:47am

Thanks, but I want many roundedplane with different colors.

Because the positions and dimensions of these rounded plane is fixed, can I pre-render all these rounded plane with the same color into a matrix and down sampling it into a 1-0 matrix so I have a black-white matrix. Then I can multiply it by a color matrix to get the final product. Will this way hurt the performance/frame rate, if the dimension of the matrix is thousands by thousands?

#196561
Nov 23, 2011 at 11:16pm

as joshua said, probably best to use javascript of poly~ for this.

#196562
Nov 24, 2011 at 4:55am

So assuming I want to use poly~ to draw multiple gl.sketch object, does that mean I draw on a single gl.sketch object in the ploy~ patch? That's what I do in the attached patch. I generate a 6 plane matrix (2 planes for position and 4 planes for color), then iterate the matrix using jit.iter and send the resulting list to the poly~ patch. The poly~ patch receive the list and draw a single rounded plane. The patch run well for the first several seconds and then the frame rate drops.

Also, do I need to mute and unmute the poly~ patch even though I have no audio in the poly~ patch?

[attachment=177215,2961]

Attachments:
  1. polytest.zip
#196563
Nov 27, 2011 at 8:29pm

hi larme.
you are not using poly~ correctly.

in this case, you don’t need poly~ at all. you can use a single jit.gl.sketch object.

here’s your patch modified to do this:

– Pasted Max Patch, click to expand. –
#196564
Nov 28, 2011 at 6:35pm

Thanks. It now works!

#196565

You must be logged in to reply to this topic.