This project has moved. For the latest updates, please go here.

Movement on a SIN curve

Oct 23, 2007 at 9:28 PM
Hello, I'm having trouble getting an object to move on a sin curve. I have the object moving on a really rough sin curve using this line of code:

this.body.LinearVelocity = new Vector2(this.body.LinearVelocity.X, (float)Math.Sin(gameTime.TotalGameTime.Seconds) * 100);

Could someone point me in the right direction for smoothing out this SIN curve? If I use milliseconds instead of seconds, the curve is smooth but the frequency is way too fast. Is there a more efficient solution using body.Applyforce() or body.Applyimpule() ? Thanks!