Help with implementing "pool" ripple effects on a gridshape
Hey,
I'm working on something and I can't figure it out.
I'm trying to implement Andrew Benson's "Pool" patch into my patch and I can't seem to get something working.
I'm trying to use the plane distortion effects on my gridshape. However, When mouse clicking, only an area in the top left hand corner applies the desire effect to the gridshape (it also seems to be flipping the effect vertically, down being up and up being down).
Ideally I would like it to be so that clicking anywhere on the ENTIRE window which defines the areas being rippled on the gridshape, and that if I resize the floating window that area can change (I tried using a "get size" on the window for this but no joy)
I'm sure it's something to do with contrasting matrices but I can' seem to figure it out. Excuse the messyness of the patch, it is a stripped back version of my patch. the main focus is in the top left of the patch where the "pool patch" is being implemented.
The rest is of no importance.
Any help would be much appreciated
PS - Has anyone made a GL version of the "pool" patch?
THANKS
Cian
{
"patcher" : {
"fileversion" : 1,
"appversion" : {
"major" : 7,
"minor" : 3,
"revision" : 4,
"architecture" : "x86",
"modernui" : 1
}
,
"rect" : [ 308.0, 118.0, 1250.0, 838.0 ],
"bglocked" : 0,
"openinpresentation" : 0,
"default_fontsize" : 13.0,
"default_fontface" : 0,
"default_fontname" : "Arial",
"gridonopen" : 1,
"gridsize" : [ 15.0, 15.0 ],
"gridsnaponopen" : 1,
"objectsnaponopen" : 1,
"statusbarvisible" : 2,
"toolbarvisible" : 1,
"lefttoolbarpinned" : 0,
"toptoolbarpinned" : 0,
"righttoolbarpinned" : 0,
"bottomtoolbarpinned" : 1,
"toolbars_unpinned_last_save" : 7,
"tallnewobj" : 0,
"boxanimatetime" : 200,
"enablehscroll" : 1,
"enablevscroll" : 1,
"devicewidth" : 0.0,
"description" : "",
"digest" : "",
"tags" : "",
"style" : "",
"subpatcher_template" : "",
"boxes" : [ {
"box" : {
"bgcolor" : [ 1.0, 0.0, 0.0, 1.0 ],
"fontname" : "Arial",
"fontsize" : 11.595187,
"id" : "obj-13",
"maxclass" : "newobj",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 1015.166748, 471.0, 85.0, 22.0 ],
"style" : "",
"text" : "s pwind_dump"
}
}
, {
"box" : {
"id" : "obj-12",
"maxclass" : "comment",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 1063.0, 310.0, 150.0, 21.0 ],
"style" : "",
"text" : "ON"
}
}
, {
"box" : {
"id" : "obj-3",
"maxclass" : "newobj",
"numinlets" : 1,
"numoutlets" : 1,
"outlettype" : [ "bang" ],
"patching_rect" : [ 366.0, 824.0, 64.0, 23.0 ],
"style" : "",
"text" : "loadbang"
}
}
, {
"box" : {
"id" : "obj-172",
"maxclass" : "message",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 1201.0, 530.333313, 54.0, 23.0 ],
"style" : "",
"text" : "getsize"
}
}
, {
"box" : {
"id" : "obj-221",
"maxclass" : "button",
"numinlets" : 1,
"numoutlets" : 1,
"outlettype" : [ "bang" ],
"patching_rect" : [ 611.0, 598.0, 24.0, 24.0 ],
"style" : ""
}
}
, {
"box" : {
"id" : "obj-195",
"maxclass" : "comment",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 508.0, 372.0, 150.0, 21.0 ],
"style" : "",
"text" : "Mouse Bits"
}
}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-144",
"maxclass" : "newobj",
"numinlets" : 1,
"numoutlets" : 2,
"outlettype" : [ "jit_matrix", "" ],
"patching_rect" : [ 245.0, 1481.0, 77.0, 22.0 ],
"style" : "",
"text" : "jit.matrix kro"
}
}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-171",
"maxclass" : "newobj",
"numinlets" : 2,
"numoutlets" : 2,
"outlettype" : [ "jit_matrix", "" ],
"patching_rect" : [ 226.0, 1450.0, 234.0, 22.0 ],
"style" : "",
"text" : "jit.op @op +"
}
}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 11.595187,
"hidden" : 1,
"id" : "obj-234",
"maxclass" : "newobj",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "bang" ],
"patching_rect" : [ 212.0, 553.0, 49.0, 22.0 ],
"style" : "",
"text" : "del 100"
}
}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 11.595187,
"id" : "obj-237",
"maxclass" : "comment",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 260.0, 899.0, 53.0, 20.0 ],
"style" : "",
"text" : "damping"
}
}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 11.595187,
"id" : "obj-238",
"maxclass" : "message",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 348.0, 945.0, 27.0, 22.0 ],
"style" : "",
"text" : "0.9"
}
}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 11.595187,
"id" : "obj-239",
"maxclass" : "message",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 348.0, 922.0, 33.0, 22.0 ],
"style" : "",
"text" : "0.99"
}
}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 11.595187,
"id" : "obj-240",
"maxclass" : "message",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 348.0, 899.0, 40.0, 22.0 ],
"style" : "",
"text" : "0.999"
}
}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 11.595187,
"format" : 6,
"id" : "obj-241",
"maxclass" :
Sorry, for convenience here is the max patch. Any help would be gladly appreciated!
Not behind my computer at the moment (so I can also not check your patch) but form memory: there is a pool patch in the examples folder that uses a nurb. That is in 3D and can be clicked anywhere (in the pwindow). The nurb can also get textures attached or be in poly mode, with a low dim size it looks also low poly...
Hey @MRMAARTEN
Thanks for getting back. I had a look at the nurbs version. It's a little more "involved" than I need I think. It doesn't work on clicking on the window (that changes the 3D perspective). I got the patch working using idlemouse (I plan to port this to the kinect), however I'm still dealing with the "hoverable" area only being a small amount of the "goo" window. I'm certain it's because I'm applying the matrix wrong somewhere along the signal flow...... :/
Any how, I think I'll try map what I have to the kinect with this "hoverable area" in the "goo" jit window, should work for my purposes.....hopefully :)
what I have so far......
Hi Cian
You can make the nurb pool work the same way you made you patch work: by getting the screen coordinates out and mapping them (with [scale ...] )to the pwindow of the matrix (or the matrix directly).
I looked at your patch: the reason you drag area is small is because you didn't scale the screen size with your matrix size. You can just scale your values after you unpack them. If you resize the window you have to also resize the scaling...
The second reason is because your plane is not centered in the screen. Where is mouse is does not match up to where the plane is.
Here is you patch with the scaling