[Jitter Newbie] Question concering jit.gl.gridshape object movement.

    Nov 25 2011 | 1:53 am
    Hello guys,
    I am relatively new to Jitter and OpenGL. I am currently working on a simple OpenGL performance and I wanted your advice on this.
    When you are using jit.gl.gridshare and let's say, you want to have a sphere move in a circle, the best way to go about it is to modify the XY numbers in [pak position 0. 0. 0.] with [line] and [linedrive]-type of ramps, in order to create movement or is there an easier way to create simple type of movements? Or a more intuitive jit object to create movement for 3D objects?
    Thank you, and very sorry for the very vague nature of this question.

    • Nov 25 2011 | 5:04 am
      Not sure is "move" and "turn" are native to the gl.gridshape object but you can use jit.anim.node (attached to inlet of jit.gl.gridshape) and send messages like "move 0.1 0. 0." every frame, which reads "move object 0.1 OpenGL units per frame".
      Should work just fine for your purposes.
    • Nov 25 2011 | 7:19 am
      Hmmm, sounds interesting, I understand... [jit.gl.gridshape] allow "position" messages, not sure if it's logistically the same as "move", but I will try your method!
      And in order for a 3D object to create an automated performance, people usually use objects like [line], [linedrive] etc.? Or as I said before, is there a more intuitive way to create basic grid movements, like a 3D ball moving in circles?
      I tried manually creating a movement in circles, with [line~] and [curve~] but it requires a lot of math, it just doesn't seem that practical to create grid movement with ramp objects...
      ...Unless that's the only way to do it.
    • Nov 25 2011 | 6:16 pm
      "the only way to do it" is blasphemy in Max land! :) :)
      One quick way to start in the patch below, recording manual motions with [mtr].
      Alternatively, maybe you have a video editor or other program which can generate movie clips with colored dots moving in the patterns you're interested in. Flash is an example, with its ability to easily animate shapes along predefined (including drawn or geometrical) paths. Make a movie of the results, bring it into Max, then use jit.findbounds to track the dot...no problem. You can then scale the resulting coordinates to match the GL world.
    • Nov 25 2011 | 6:25 pm
      So many ways to do it I can't even count.
      Look at the help patch for jit.anim.path, you may like it.
      Position is absolute, move is relative.
    • Nov 25 2011 | 8:06 pm
      Sorry, Seejayjames, I should have known better, I take it back!!
      That's a massive help, but it seems like huge roundabout in order to create a simple idea, doesn't it?? I am definetely keeping your Max patch suggestion for something near-related that I will be doing soon though.
      I can't seem to find jit.anim.path... Is it an external or a Max 6 exclusive?
    • Nov 25 2011 | 8:45 pm
      All is forgiven :)
      ...and yes it is totally roundabout!
      Glad you can keep the patch for alternate uses. [mtr] can be very handy.
      Probably would need to spend some time grappling with [expr] etc. to really get a handle on what paths/motions you can generate. I haven't tried jit.anim.path yet, sounds like just what you're looking for...Max 6 only though. upgrade on the horizon? :) that will likely be my holiday gift to myself. tooooo many cool new things not to!
    • Nov 25 2011 | 9:39 pm
      I tried making exponential curves with [curve~] and [linedrive] but it'll require too much math just to get one good circle, and I need multiple ones of different size for my project, so that'll be brain-intensive to say the least!
      Yes, I think it's time for the big move... I was trying to postpone is as much as possible, having been very used to Max 5 and the workflow I created for myself, but I think now it's inevitable!
    • Nov 26 2011 | 12:18 am
      I had help from a buddy of mine, he suggested sin(pi) and cos(pi) type of trigonometric math with [expr] so that's exactly what I wanted. Thanks for all your help though, all of you!
    • Nov 26 2011 | 1:28 am
      With the right values to sin and cos (from 0 to 2PI) you can get circles, it takes some fiddling and dusting off the trig neurons :) also cartopol can definitely do it as well, but I haven't quite gotten that one to do what I want yet.
    • Nov 26 2011 | 2:01 am
      Exactly! We came down to this:
      expr sin($f1 * 2. * 3.141593) + expr cos($f1 * 2. * 3.141593)
      (just posting it here, for future reference for everyone!)