Cosm - having agents revolve around each other

    May 16 2011 | 10:34 pm
    I am wondering if anyone has got an Idea of how one can make agents revolve around each other using the Cosm library - like say; something similar to electrons revolving around a nucleous
    I want to be able to get agent1 to revolve around agent2 as soon as agent2 is the same color - for example
    Best regards.

    • May 17 2011 | 8:12 pm
      I think using the query position object you can use getters and setters, so you'd query the position of agent1, assign that position to agent2, the assign the move f f f message for agent2, to reflect the radius of the orbit.
      I'm probably missing a bunch of steps but I don't have my computer in front of me.
    • May 17 2011 | 11:45 pm
      Thanks for the reply :)
      What I have been trying is sending xyz position data from agent1 to agent2 (each has his own patcher)
      Then I have checked if the data is coming out right - and it does - so I assumed I could just put it through gates (three gates that is) and turn the gates on when I want them to instantly be in the same place
      I am taking the position data and putting it to the input of cosm.nav with (pack 0. 0. 0.) exactly like is done in the tutorial on the cosm website - but the behavior I get from the agents is always like I am just resetting them to home (that is; position 0 0 0)
      I,ve spent two hole nights going back and forth, trying to do this simple task but I always get just the position "reset" straight in the middle of the level.
      Do you notice from my description anything obvious that I might be missing
      Thanks again :)
    • May 17 2011 | 11:48 pm
      To be clear - I would rather that the agents would orbit around each other, but until i can get them to just simply meet at the same cordinites - then I figure I shouldnt complicate things
    • May 18 2011 | 8:10 pm
      try posting a patch, I'm not sure what might be the problem just based on the description.
    • May 18 2011 | 11:13 pm
    • May 18 2011 | 11:14 pm
      ouch, copy compressed senior, it got clipped
    • May 18 2011 | 11:17 pm
      Oh and btw - Ive been testing the zl compare object using just intigers - I just named them agent1/2_color to illustrate
    • May 18 2011 | 11:30 pm
      Ive tried four times alreayd to post now but nothing appears
      And I cant edit the code either
    • May 18 2011 | 11:31 pm
      Really? Select all, copy compressed, and paste doesn't work?
    • May 18 2011 | 11:34 pm
    • May 19 2011 | 9:06 pm
      Oh, I see. Try using cosm.query for what you are trying to do, not cosm.field.query.
      Stick this in your patch, disconnect the other junk that's positioning the second agent and you'll see this will make take the position and rotation of the other agent when the gate is open.
    • May 20 2011 | 4:49 am
      hey man it seems like you are miles away if you want electrons moving around a nucleus in a somewhat scientific manner. check this patch from the inventors of cosm to move forward. but then again some people learn from scratch others by looking at examples..
    • May 21 2011 | 5:36 pm
      Thanks alot guys
      Im not neccissarilly trying to do an exact model of electrons - I just want to try out attraction mechanisms and see where it gets me
      thanks again :)