Results 1 to 6 of 6

Thread: How to maintain animation speed!?!?

  1. #1
    Member Newbie
    Join Date
    Jul 2003
    Posts
    33

    How to maintain animation speed!?!?

    With animation i mean any animation. For example blending how do i make sure that the blend speed is the same on every PC. Intro logo blending from black fo full -> full to black. Light that is glowing etc.

  2. #2
    Senior Member Regular Contributor
    Join Date
    Apr 2003
    Location
    Toulouse, France
    Posts
    133

    Re: How to maintain animation speed!?!?

    for example for fade in/out you have to update a fade speed according to the actual fps.

  3. #3
    Member Newbie
    Join Date
    Jul 2003
    Posts
    33

    Re: How to maintain animation speed!?!?

    But wont the fade go faster with that!? What i meant was to make sure the the fade will take for example 3sec.

    edit

    I was thinking about using "Sleep(msec)" but thats so newbish lol

    [This message has been edited by GL_ZERO (edited 08-27-2003).]

  4. #4
    Senior Member Regular Contributor
    Join Date
    May 2003
    Location
    Germany
    Posts
    229

    Re: How to maintain animation speed!?!?

    Use the high performance counter to query the time needed to draw a frame and the calculate your speedfactor depending of the hpc's counters before the frame and after the frame.
    If you do that, then you'll get a timefactor that you'll have to use on all your animations to get the same speed on all systems.
    Take a look at QueryPerformanceCounter for more info.

  5. #5
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,068

    Re: How to maintain animation speed!?!?

    I think that you should look at it in a larger view.

    You have the following things that effect your animation.

    1. Speed of the computer
    2. Speed of the video card
    3. How detailed the scene is being rendered.

    Now we want to fade from one scene to another in X seconds.

    So we need to come up with a rate of fade based on the above items.

    To do this we can get the system time at start of rendering and after rendering.

    render_start = time();
    fade();
    render_end = time();

    render_time = render_end - render_start;

    render_rate = 3 (seconds) / render_time;

    render_rate is how may frames we will have to make the fade transition. A slower computer will have less frames to complete the transition vs. a faster computer will have more frames.

    Hope this helps.

  6. #6
    Junior Member Newbie
    Join Date
    Jul 2003
    Location
    Townsville, QLD, Australia
    Posts
    23

    Re: How to maintain animation speed!?!?

    as PanzerSchreck said, using a timer is the way to go. so search google for QueryPerformanceCounter, and play with that a bit. nexusone solution would most likely work, but it isn't very flexable, and is more work than u really need to do.

    I personally have some predefined classes that i've written using QueryPerformanceCounter, and i just move those classes from one program to another, with no difficulty at all.

Similar Threads

  1. How to maintain multiple viewports?
    By rakeshthp in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 06-01-2015, 10:25 AM
  2. Maintain alignment of two objects with modelview
    By tkdd08 in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 04-06-2013, 09:38 PM
  3. Maintain Focus
    By Andrew Jameson in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 10-09-2003, 03:34 PM
  4. How to or can I speed up animation using glut?
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 07-15-2001, 09:17 PM
  5. More on how to maintain perspective
    By in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 11-05-2000, 10:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean