Cosm - having agents revolve around each other

edsonedge's icon

Hi

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.

cap10subtext's icon

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.

edsonedge's icon

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 :)

edsonedge's icon

P.s

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

cap10subtext's icon

try posting a patch, I'm not sure what might be the problem just based on the description.

edsonedge's icon
cap10subtext's icon

ouch, copy compressed senior, it got clipped

edsonedge's icon

Oh and btw - Ive been testing the zl compare object using just intigers - I just named them agent1/2_color to illustrate

edsonedge's icon

Ive tried four times alreayd to post now but nothing appears

And I cant edit the code either

cap10subtext's icon

Really? Select all, copy compressed, and paste doesn't work?

edsonedge's icon

Lets try this:

2263.Cosmrevolveagentsexample.maxpat
Max Patch
cap10subtext's icon

Oh, I see. Try using cosm.query for what you are trying to do, not cosm.field.query.

Max Patch
Copy patch and select New From Clipboard in Max.

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.

tsiwt's icon

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..

2272.cosm.love.and.exploration.triangle..maxpat
Max Patch
edsonedge's icon

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 :)