We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › diferences between curve techniques for movement
Page Index Toggle Pages: 1
diferences between curve techniques for movement (Read 238 times)
diferences between curve techniques for movement
Feb 17th, 2009, 12:18am
 
hi, i was experimentating creating curved movements of agents using 2 different approach, one is using exponential functions to draw curves and use them as a movement path for the agents, and the other is using sin and cos, i would like to know which is the difference between these both techniques. is there one that is better? or one that have a benefit against the other?


many thanks

m.
Re: diferences between curve techniques for moveme
Reply #1 - Feb 17th, 2009, 12:59am
 
There's surely no way to give a definitive answer to a question like that.

It all comes down to what kind of motion you're trying to model.  If your "agents" are bits of flotsam floating in the ocean, where gentle waves buffet them up and down, then using trig functions is probably the way to go because sines and cosines match the actual motion of waves very well.  There's actual physics behind that choice.

If you're trying to model the way birds fly or something else, then having your birds bobbing up and down on cosine-driven curves, like corks on the ocean, is going to look stupid because everybody has an intuitive sense that birds don't fly like that.

Give us a hint as to what you're actually trying to achieve and maybe we can offer some guidance.  The best I can do for general guidance is:

"If you're modeling a physical process, look to the math that describes that process to know what to use.  Otherwise, just use whatever pleases you best aesthetically."
Re: diferences between curve techniques for moveme
Reply #2 - Feb 17th, 2009, 4:12am
 
hi, i was thinking that the same kind of movements can be achieved by this 2 approaches, am i right? for example in the 3d bird example it uses the sin a cos to make the movements of the bird, thats why im asking i dont know in which cases using exponential functions can be a good idea.....but  what im trying to do is to make simple agents that can evolve its behaivor or motion using a genetic algorithm so i would like to have a lot of kinds of motion that can be expresed in a group of parameters.  what do you think is the best way of doing this?

do you know anybody that have tried something like this before?
Re: diferences between curve techniques for moveme
Reply #3 - Feb 17th, 2009, 7:02pm
 
The "nature of code" website (http://www.shiffman.net/teaching/nature/) has an excellent series of articles that cover all kinds of underlying concepts that I'm guessing you could use to read about, most of them discussed and implemented in Processing.

And while I would highly encourage you to work through the whole series, there is one particular article about the exact thing you're trying to do:

http://www.shiffman.net/teaching/nature/steering/
Page Index Toggle Pages: 1