Cosm – having agents following each other in cosm
I am using the Cosm library, and I have a few agents with randomly fluctuation colors. I want agents to follow each other based on if they are the same color, at any given moment
I am getting the XYZ world coordinates from each one – and am using (ZL Compare) and (gate) to check if agents match and send coordinates to the other same-colored agent – but when I send them through (pak position f f f) and to (cosm.nav) of the other agent, the only thing that happens is that the agent is positioned in the middle of the world.
In other words; they dont follow each other but are only repositioned in the place the start when the patch is loaded
If anyone has been building algorithms to have agents chaise eachother It would be much appriciated if you could show me how you have done it.
The best example are in the cosm example patcher in the Camera Follow subpatch. But I think you have to send the position xyz to the object directly.
The proper way to do this I think though is a little trickier. Will investigate.
----------begin_max5_patcher---------- 1162.3oc4ZssjZiCD8Y3qPEEOraB3x5luj2x2wVakxiQP7VXaFaQxjjJ+6Q2 7.YVvV1FDtpTCi8HgQ5ni5tOcKleLe1hmJegUu.7Av+.lM6GymMS0kriYl1y Vjm7R59jZ0isHqXOiuXk9cJNlqZqdK+ScVdj2zKzz6gDd5myJ18oJVJWOgXr um+Jf9Jh1bE7ulOR1F0LV9z+sF1Li5Ql+sCL8XHviXzZ9Dok44rB0vuXgrqe Net7xJKWb7xc61yt3pCNvUWfd0850Ks5Bvcr7FvRof8UwP2Ltb1KZVYWBmAd kM2VVvqy9tZxfHO+KsvQCbgGEKuRHstv+MjTjjqPxhOVkkr+pTxMkOpDCOCb nrNimUVzGd4xFDnN4EXfxROB2FwfiFBwrZnjSNqtNYG6+wNh9J3vAQOC0rAB Cj2hQpFQWgdhez1Mok04dOejU8MmXyfij2Ba0lg36Talq4PAp4rC8gT5utAk dJxJA1JmfdzFJuCrF5cQ5fbqbbLDAVwJXk6CBek.tCfN1tuLgeiiqHVZEbvR 3ckXnHCin3mvPEw.uLwPmFBQaxp4IEoLPYUlHzKn9.isoOjzkivP5NBSrhqf gwsY9fGZDlU2gHMbvSf8imaZI5KJTm1lwNB2F0Lj.MOkTr6lSKNRYBocmhB5 VXJHbRjLSpXhqR.4kegA7k+rBX5herp..0cdWywwPZAZ5BQZKGmffGcHoZ19 aAezsQDN7LkqqYDQlJNXeOO4fTTGHds12SX230qBpn81pIRE+gnKb.BoswST 2ojYqi1x6a8lMzitfSntT6q4UQd3B8qAPeu6bTFcBgZl.2p4BA61LBe7kgaX mlSonUkqvoPEUrWNHJp54J9esbK7chee+xsHwcj3NVbG+28guvCzZBGaxSrU BK5Q6c8EEaIHo0BBxEdYlpKf9gsddNn+PNvBSvXJLt67BQASo7BUIAtDBVh. Kwfkj6pwCID4QkGdg5bcf5Cw3ZZVwSEE8mOlveMoYmbnfMUfEZN5z3VOUP7e JNYlPO99c6jggSAMLoky1jTQ9fd9zwyMc6Yg05TsKuiFhm09r52j6iZnE8W7 1uIME7j8+6DVc4wpzlgynZBNAvMrZdVQhx25zyHST6rG5yYa1vJN+3Syy1bn LqfavvU18rERuY5tLlj0Z3PLgsklftCR1r041ct.anIY0z8ASXbrzqR6NIJT 272iEp1ZigcpMFxFHQlTPJv4Nh3NPDpeHhDqLvPHc.6vSstAXE10FZOcFhQd QXLlPjmcUjDoTLQAXYqQBXpENERgq9fXC7vQQ5SJQ8kqpZMRvhrfc6KXQBoa IWF.UoHqAqpkC.KF0O8iy.qJxX3qstAfsSgE2prDZCj5oeuwSGS0z3YsFq1B wFYP2F2LvFAufP2FK2lzEjEQ3PLEaSHvdt0YhiPgZAlXU.QUqwRf13oF418T nEPxslYTaj0HtsdBB8NXm4hstdqnZBqp+BGaj+ksFqHkMdpwtcS0F2Q4+2gN rJQa1SCbb8891D12wgsrwZ5M.eZTMsakGCrwdBOF2NQieN+W.bOsfPA -----------end_max5_patcher-----------
I am trying to use the camera follow subpatch above
It works fine for a while (about a minute) but after that, the camera sets on a certain trajectory and stops following the given agent??
seems like a bug
Also, when this happens the W,A,S,D buttons stop working ( they work until this "bug" starts its thing)
Any good ideas of what might be causing this to happen ?
All the best.
There could be a bug in the camera tracking patch; maybe the quaternion is not being normalized (small differences can accumulate over time, leading to bizarre results), or maybe its an issue with measuring the distance in the toroidal space. I’m sorry that with the Max 6 release workload we probably won’t have time to look into this now.
Try changing the speed at which the camera follows (slow it down) or vary the distance to the followed object – might not fix it, but might make it take longer to become apparent. Sorry I can’t be more helpful right now.
Yeah if I jerk the rotation control of each agent – then it starts working again but stops working after the same time interval, after that
I have yet to test if changing speed will affect it in any way
I am trying to get agents to follow each other like a flock and I would actually like the following-patch to be faster than in the above example
I understand that many Max-ers are busy with Max6 coming out, but if you have any other examples (or can point me to) of agent following patches or methods, it would be much appriciated
(also if you have any more documentation or examples than is on the cosm website/download I would be very interested.)
Thanks alot for the response
Did you manage finally to get it?
I´m also interested in something similar. I want to find an ant logarithm; agents tracing ´pheromonic´ paths, that lead the other agents to the same target, constructing at the end a well-shaped and optimized path as ants do in real life.
I know that this algorithm exists, but I can´t find something simiar in Max.
Forums > MaxMSP