Inputting single coordinates into GL objects

    Jitter

    Bas van der Graaff's icon
    Bas van der Graaff's icon
    Bas van der Graaff
    Nov 21 2007 | 10:33 am
    Hi there,
    I was wondering whether anyone could tell me if there is a convenient way of inputting single parameters (that are usually part of a list) into GL objects, such as gridshape.
    I'm interpolating between different values for a single, user-selected param (such as x-coord or y-rotation). The other values are, of course, stored inside the GL object, and while i could keep them somewhere else as well, this is extra work and double data storage.
    In the example below I built what is necessary to update the X and Y-coord. It works, but it gets a lot bigger when i also want to add rotation, scale, color, blend_mode...
    I suppose there is no magical 'position 1.23 $ $' or similar message to just input one? And there are no functions like positionx() in the gl group? Has anyone done something like this before and what would be the best way to do this? Thanks, Bas.
    Max Patcher
    In Max, select New From Clipboard.
    Show Text

    • Zachary Seldess's icon
      Zachary Seldess's icon
      Zachary Seldess
      Nov 22 2007 | 6:45 am
      I don't know of any way to update, say, the x position value without including y and z values. It's hard to give solutions without more knowledge of what you're after, but here's something (slightly simpler than what you posted).
      Max Patcher
      In Max, select New From Clipboard.
      Zachary
      Share
    • Bas van der Graaff's icon
      Bas van der Graaff's icon
      Bas van der Graaff
      Nov 22 2007 | 1:25 pm
      Well, explaining the whole thing is a bit pointless, but I want the user to select a single object, then a single parameter, and then control that single parameter (of a gridshape) by mouse or any other input, doesn't really matter.
      The example you posted is fine, although i don't think it differs much from my one. It works fine, but when I want to allow the user to select the param, the whole thing gets quite big. It's not even that it's too difficult to make, just that I don't like using too many objects. Since there may be quite a number of gridshapes to select from, this makes for quite a number of max objects, affecting load times etc.
      In the mean time, ill stick with keeping all the parameter data somewhere else, it much easier to e.g. grab it from a coll than getting everything from the gridshape itself and routing it. Thanks for your post anyway,
      It is illogical to implement separate input functions for each parameter? I know it's done by something like glMoveTo3f() internally, but separate inputs could come in handy in some situations (especially since keeping variables and pointers is so much harder in Max than in a conventional language).
    • Rob Ramirez's icon
      Rob Ramirez's icon
      Rob Ramirez
      Nov 22 2007 | 5:35 pm
      i'm not sure i understand the problem. "pak position 0 0 0" does store the x, y, and z positions for you, with one object, no?
      and you can just send a single parameter to this and have it sent to the gridshape. why would you need positionX?
    • Bas van der Graaff's icon
      Bas van der Graaff's icon
      Bas van der Graaff
      Nov 26 2007 | 10:14 am
      That's correct, It's not a problem. But I'm using up to a 100 gridshapes, and take into account that I want to be able to input rotation, color, scale and blend_mode as well.
      This would add up to 500 paks to my patch, which wouldn't be a problem in itself, but I want to update everything from saved data as well, which would mean I'd have to make sure not every single pak outputs multiple times (or also add a pack), etc.
      It's all very possible, I was just wondering what the best method is. And if those positionX() methods would have existed, i'd be instadone. From a programmers pov, pak is effectively storing data while this is already being done within a gridshape. But thanks for your replies, i already got it working...somewhat.
    • joshua goldberg's icon
      joshua goldberg's icon
      joshua goldberg
      Nov 26 2007 | 2:50 pm
      pattr.
      On Nov 26, 2007, at 5:14 AM, Bas van der Graaff wrote:
      > > That's correct, It's not a problem. But I'm using up to a 100 > gridshapes, and take into account that I want to be able to input > rotation, color, scale and blend_mode as well. > > This would add up to 500 paks to my patch, which wouldn't be a > problem in itself, but I want to update everything from saved data > as well, which would mean I'd have to make sure not every single pak > outputs multiple times (or also add a pack), etc. > > It's all very possible, I was just wondering what the best method > is. And if those positionX() methods would have existed, i'd be > instadone. From a programmers pov, pak is effectively storing data > while this is already being done within a gridshape. But thanks for > your replies, i already got it working...somewhat. > -- > SmadSteck - http://www.smadsteck.nl > Hard- and software for interactive audiovisual sampling >
    • Mattijs's icon
      Mattijs's icon
      Mattijs
      Nov 26 2007 | 3:49 pm
      Quote: joshua goldberg wrote on Mon, 26 November 2007 15:50 ---------------------------------------------------- > pattr. >
      Ah, I didn't know binding to jitter attributes works with pattr, nice feature :)
      So I assume Bas would ideally like to have:
      Max Patcher
      In Max, select New From Clipboard.
      Mattijs
    • joshua goldberg's icon
      joshua goldberg's icon
      joshua goldberg
      Nov 27 2007 | 2:29 am
      no. something like this:
      Max Patcher
      In Max, select New From Clipboard.
      On Nov 26, 2007, at 10:49 AM, Mattijs Kneppers wrote:
      > > Quote: joshua goldberg wrote on Mon, 26 November 2007 15:50 > ---------------------------------------------------- >> pattr. >> > > Ah, I didn't know binding to jitter attributes works with pattr, > nice feature :) > > So I assume Bas would ideally like to have: > > #P window setfont "Sans Serif" 9.; > #P window linecount 1; > #P newex 274 243 159 196617 pattr @bindto gridshape::rotatex; > #X prestore 1 0 0; > #P objectname u378004689; > #P newex 274 263 159 196617 pattr @bindto gridshape::rotatey; > #X prestore 1 0 0; > #P objectname u687004690; > #P newex 274 283 158 196617 pattr @bindto gridshape::rotatez; > #X prestore 1 0 0; > #P objectname u626004691; > #P newex 274 312 78 196617 jit.gl.gridshape; > #P objectname gridshape; > #P window clipboard copycount 4; > > Mattijs > > -- > SmadSteck - http://www.smadsteck.nl > Hard- and software for interactive audiovisual sampling >