Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Shift to the time domain

This topic is 5713 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

Hi everyone, I have a question that has kind of stumped me for awhile. I have a function:
this.y += Sinus[this.theta];
that I was using to move a particle along a path, but I need to make the motion frame-rate independant. Like the regular position functions:
this.x = this.x0 +(this.velocity * Cosinus[this.theta]*currentTime);
this.y = this.y0 + (this.velocity * Sinus[this.theta]*currentTime);
I vaguely remember from school that a fourrier transform would shift a function to a different domian. But as I recall it would shift a function out of the time domain. I guess my main problem is I am not so sure how to traverse a sine or cosine wave over time... I am guessing once I had this peice of info i wouldn'' be to hard to add a velocity factor into it. Any help would be greatly appreciated. "And then 2 men appeared... Men in dark suits.. with dark soulless eyes. Men like this could have come from only one place..
The bank."

Share this post

Link to post
Share on other sites
I think you''re trying to make this way too complicated. All you have to do is base your theta on time, so instead of this.thetaAdd(1) do this.thetaAdd(omega/framespersecond)
where omega is the rotational velocity (ie radians/sec or something like that)

Also, you would want to move your x the same way.

So this.x += this.velcoity/framespersecond);

and that''s about all there is to it.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!