#### Archived

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.

## Recommended Posts

Hi everyone, I have a question that has kind of stumped me for awhile. I have a function:
this.x++;
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 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.

1. 1
2. 2
3. 3
Rutin
25
4. 4
5. 5
khawk
14

• 11
• 11
• 23
• 10
• 9
• ### Forum Statistics

• Total Topics
633649
• Total Posts
3013117
×