Cosm – having agents revolve around each other
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
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.
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 :)
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
try posting a patch, I’m not sure what might be the problem just based on the description.
ouch, copy compressed senior, it got clipped
Oh and btw – Ive been testing the zl compare object using just intigers – I just named them agent1/2_color to illustrate
Ive tried four times alreayd to post now but nothing appears
And I cant edit the code either
Really? Select all, copy compressed, and paste doesn’t work?
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. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 446.3oc4UFrbCBBDF9r9TvvYalfnFs25yQmLcLJ0PGErBYZRyj28JqZSRahw lZykdAFVfc+2OVfs1V3Ex0LEFcO5Qjk0VaKKvjwfU6XKbQ75j7XErLrVlkky vNMSIVUHWoyYZXRRq0xXcxRtH6oJVhtw4gA9Sl5fHSCLctS6ZQya2COEbubw K2ED149Feq2TxZ7BlKp8278AmK9L1Fa6rsMMNCLWDr2piWWvzr0fXwYw5Kjf OKEZQbAnJ7CU73bbOodDERcef.TudSc+yl56yaSzU72gIHt0t6D3vc7vQhTU L40UrpMmFJtWCThnPI.YFwzMi1KT7NOTb9ofYDqSJqXkLQJJNiIzjQrhIh1b YooVIxuW3PGoJlQDLUHklUNp.wHZjGPBORe7ve1HwioWAOJXJUc0v2.BTg3h JkJtlKENnVCUR839VSDEtIEB3hDDAcgmlTzf+Mu0b3eOW3sl+nmZfMhy4hu9 aKnWi8igkRtpJoKzcmVn8RNkozbQroZ5fEc7ZVxSSYvzcxqfmVJq+CsUCn4m 7janRxbU6hRhda0zfnD81JovgnI+aqlnCUSjaml7Ghl79EbpdvN6OzZ2E1J -----------end_max5_patcher-----------
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..
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 :)
Forums > MaxMSP