Jump to content
  • Advertisement
Sign in to follow this  
ryt

I need help with waves

This topic is 3624 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I know that I can generate waves using waves equation. Using: y = A * sinf((1/wavelenght)*angle + offset) This equation generates waves all along lets say x, and goes up and dawn in y. But I would like to generate single wave instead of many waves. Here is an exsample how it would look like: -------------------o ----------------o-----o --> --------------o---------o oooooooooooooo-----------oooooo ooo is the wave. How can I do that? Maybe I could modify wave equation or use something else?

Share this post


Link to post
Share on other sites
Advertisement
Hmm that looks like a gaussian curve. You can do it like a gaussian curve with mean value which corresponds to the maximum of that wave.

http://en.wikipedia.org/wiki/Gaussian_curve

Also if you want the limits of your wave to be lets say a and b, you can write a condition which will multiply your function with 0 in all places except between a and b.

Depends on where do you want to use it.

Share this post


Link to post
Share on other sites
The Gaussian courve looks a little cumbersome, I would like something simpler.
Good idea to multiply the wave outside [a,b] with 0, i could try that.

Share this post


Link to post
Share on other sites
I might be out of my league now ( I'm a beginner ) but if you want one wave, that is a wave shape, so the graph of a 2nd degree function ( not sure how to say it in english )... so basically you would have something like
[Source] f(x) = a*(x^2) + b*(x) + c [/Source]
.

Then you have y = f(x)

- Correct me if I am wrong please -

Share this post


Link to post
Share on other sites
Well, thats another way.
I think Ill use wave equation and restrict it on [a,b].

Share this post


Link to post
Share on other sites
that is general a second degree approximation to a curve. That is still not zero outside the bounds a-b. It cuts the x axis at its two roots (say a-b) but then it tends to infinity or minus infinity as long as you let it go. So you still need to multiply that by zero for all other places except between a-b.

Gaussian curve is not that cumbersome I suppose and pretty controlable in fact

"The parameter a is the height of the curve's peak, b is the position of the center of the peak, and c controls the width of the "bell"."

91ee5f0afaf52d5cce560c4de7c58148.png

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!