Archived

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

fps independance for complex calculations

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

Recommended Posts

Hey guys! If you''ve read some of my earlier posts you might recall that I''m working on a demo that''s all about particle systems. Now, my problem is the fps independence. I know how to do it for simple things like linear movement but the calculations for these particles can become pretty involved and there are many factors that change and have an influence on teh particles movement. How do I make THAT fps independant? Do I just put the time factor in wherever I have absolute numerical values? Take for example this line of code, which is from the function that controlls particle behaviour: PHandle.Size = PHandle.Life / 10.0f; How would you make that fps independant? PHandle.Life changes each frame so there is already a time factor in that. Should I put a time factor in the 10.0f, too? Do it like this? PHandle.Life -= 0.02f * timefactor; PHandle.Size = PHandle.Life / (10.0f * timefactor); or like this? PHandle.Life -= 0.02f * timefactor; PHandle.Size = (PHandle.Life / 10.0f) * timefactor; Any advice? Please...? ----------------------------- "Mr Sandman bring me a dream"

Share on other sites
Yup. Just get the amount of time passed since the last frame, get that to where 1.0 is one second, and multiply your 10.0 by that.

-Deku-chan

DK Art (my site, which has little programming-related stuff on it, but you should go anyway^_^)

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

• 9
• 11
• 11
• 23
• 12
• Forum Statistics

• Total Topics
633654
• Total Posts
3013170
×