Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Possibility of displaying Zoom/Rotate in increments  (Read 3425 times)

0 Members and 1 Guest are viewing this topic.

AdventWolf

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
Possibility of displaying Zoom/Rotate in increments
« 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.

panithadrum

  • Sr. Member
  • ****
  • Posts: 304
    • View Profile
    • Skyrpex@Github
    • Email
Possibility of displaying Zoom/Rotate in increments
« Reply #1 on: September 08, 2010, 08:55:19 am »
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.
Code: [Select]
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!

WitchD0ctor

  • Full Member
  • ***
  • Posts: 100
    • View Profile
    • http://www.teleforce-blogspot.com
Possibility of displaying Zoom/Rotate in increments
« Reply #2 on: September 22, 2010, 08:16:57 am »
sounds like you can use some good ol' LERP!
John Carmack can Divide by zer0.

AdventWolf

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
Possibility of displaying Zoom/Rotate in increments
« Reply #3 on: September 24, 2010, 05:40:05 am »
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.

 

anything