SFML community forums
Help => Window => Topic started by: AdventWolf on September 08, 2010, 05:16:14 am
-
I want to implement a function that gradually performs some functions and displays it in increments, instead of when I choose to zoom in, it instantaneously zooms to that setting.
I have tried using a for loop, that zooms and rotates on a certain degree each turn, but it is still instantaneous, and doesn't display in increments.
Is there a way I can implement this? To delay the loop each turn?
Thanks.
-
That's because the for loop begins and ends in the same time step. You must do it so you do a step each frame.
I would do a class called Transition or something, like this.
class Transition
{
public:
float Origin, Destination, Velocity;
Transition(float origin, float destination, float velocity);
void Update(float time);
};
Be original, you can do some different transitions!
-
sounds like you can use some good ol' LERP! (http://en.wikipedia.org/wiki/Linear_interpolation)
-
Thanks guys, I've kind of backed away from sfml for a bit to head back to the books to better understand the basics. I'll be sure to look into this.