Cosm – having agents revolve around each other

May 16, 2011 at 10:34pm

Cosm – having agents revolve around each other

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.

#57166
May 17, 2011 at 8:12pm

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.

#204773
May 17, 2011 at 11:45pm

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

#204774
May 17, 2011 at 11:48pm

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

#204775
May 18, 2011 at 8:10pm

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

#204776
May 18, 2011 at 11:13pm

#204777
May 18, 2011 at 11:14pm

ouch, copy compressed senior, it got clipped

#204778
May 18, 2011 at 11:17pm

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

#204779
May 18, 2011 at 11:30pm

Ive tried four times alreayd to post now but nothing appears

And I cant edit the code either

#204780
May 18, 2011 at 11:31pm

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

#204781
May 18, 2011 at 11:34pm

Lets try this:

#204782
May 19, 2011 at 9:06pm

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.

– Pasted Max Patch, click to expand. –
#204783
May 20, 2011 at 4:49am

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

#204784
May 21, 2011 at 5:36pm

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

#204785

You must be logged in to reply to this topic.