Switching between patches
I need to be able to switch between jitter patches. I’m pretty sure I can use poly to achieve this. The only problem is that poly is very complicated.
Can anyone show me an example?
I just hope I can switch 3d patches without leaving full screen.
Do I just need to name my windows the same thing?
poly~ is for managing multiple instances of the *same* patch. For
switching between different patches, look at the drawto message to
jit.gl.render, the thispatcher object, and Andrew’s Recipe 24:
Most likely the best solution would be to set @automatic 0 on all of
your gl.objects, and explicitly bang each object. Then, you simply gate
off the objects that you don’t want to see for any given scene. Another
solution would be to use the enable attribute to turn on and off your
Thanks for the responses guys.
Do any of these solutions save on CPU cycles? This is why I thought of poly~ because it actually turns things off instead of things just looking like they are off.
The problem I am having is that poly~ doesn’t seem to turn off normal messages. It turns off signals fine, but normal messages that come out seem to keep flowing even when a mute is received at thispoly~.
Any help would be great. I’m not quite sure how to use thispatcher but that seems like it might work too. Scripts maybe?
I’m working on trying to get automatic 0 to work. Again, I’m dumb and can’t get it to work right. Do I need to place it on every gl object or just the ones running to the main screen?
Router would just be a tool to organize it all, right?
I can’t find out how to use the enable command to clear everything.
Using automatic 0 things still seem to get stuck in the screen. I looked at the GL feedback and that didn’t seem to help me even though it seemed to do what I wanted. It really didn’t seem to run right. I think it might be a Mac only patch.
To summarize my gl objects are getting stuck in the window and won’t transition to a new gl object. Any help on how to clear them would be great.
You don’t need to use automatic 0 for the jit.gl.render object.
The fact that things stay on your screen probably has to do with
the erase_color of the jit.gl.render object. The message should be :
erase_color 0. 0. 0. 1. (with the first 3 zero’s for r, g, b, the
fourth nr. is the one which cause the screen not to clear entirely
when it is set below 1., depending on how low it is, 0 being the
lowest, things will stay on screen longer or ‘fade away’ slowly.
Furthermore, make sure you use the ‘deph_enable’ 0 or 1 depending on
what you want to accomplish
when using the automatic 0 argument, you need to individually bang
every GL object in which you use it. Say you draw a primitive using
jit.gl.gridshape and a text using jit.gl.2dtext, both with automatic
0 enabled, you will see the following :
when banging the gridshape first, the shape will be drawn on screen,
then you bang the gl.text, which will be rendered on top of your shape.
If you send them a bang in the other order, you’ll render the text
first, and then the shape on top of it, blocking out the text.
The best way to do this is to send the bangs of the qmetro to a
trigger object. Where you use the amount of bangs needed according to
the amount of jit.gl.something objects you use.
In the above example that would be : t b b b erase The most right
outlet of the object is connected to the jit.gl.render, clearing the
scene, then the following two bangs to the gridshape and text object,
depending which one you render first, you connect the third outlet to
the first one you want to render on screen, and the seconde outlet to
the one you wish to bang next.
Finally, the first bang goes into jit.gl.render again which puts the
resulting image in your window.
Hope this clears things up a bit…
and/or like this :
#P user gswitch2 102 135 39 32 0 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 102 175 240 196617 jit.gl.gridshape test @automatic 0 @shape cube 0.1;
#P newex 343 175 250 196617 jit.gl.gridshape test @automatic 0 @shape sphere 0.1;
#P newex 21 136 79 196617 jit.window test;
#P newex 21 116 281 196617 jit.gl.render test @erase_color 0. 0. 0. 1. @camera 0. 0. -5;
#P newex 21 80 58 196617 t b b erase;
#P toggle 21 36 15 0;
#P number 68 37 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 21 57 57 196617 qmetro 20;
#P connect 3 1 8 1;
#P fasten 3 2 4 0 74 106 26 106;
#P connect 0 0 3 0;
#P connect 3 0 4 0;
#P fasten 8 1 6 0 136 172 348 172;
#P connect 8 0 7 0;
#P connect 1 0 0 1;
#P connect 2 0 0 0;
#P window clipboard copycount 9;
Thanks for all the help guys. I’m just trying to chug along with my limited knowledge.
Brecht I couldn’t get the example patch to open.
Is it missing header information something like:
#N vpatcher 118 283 975 638;
select it, copy, in max select file > new from clipboard
Thanks a lot guys, I really appreciate it. I’m finally getting somewhere.
The only problem is that on full screen the object duplicates and starts flashing. Otherwise it works fine in a normal window. If all else fails I will just make the window really big.
Forums > Jitter