Re: Timing issue

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi Daniel,

I've just started looking into DirectX coding myself so I might just be
fartin' in the wind here but I do know that in a GUI setting you have to
think of timing in millisecond and with a timer control in is repressented
as 250 = 0.25 sec, 500 = 0.5 sec, 1000 = 1 sec, etc. Like I said might not
even come into play here but just thought I'd try to help. ;-)

From the Newbbie
Denis


"Daniel" <DanielV@xxxxxxxxxxxxxxxx> wrote in message
news:uF0866huGHA.4952@xxxxxxxxxxxxxxxxxxxxxxx
Hey guys

I was advised that the best animation method is to update the animation on
a time basis rather than frame basis, which i agree with so that even on
varying procesor speds the animation will remain consistent.

ZMan pointed me to this formula:

if( _gameTime.Seconds/x % 2 > 0 )
//then next frame

The idea being that you set x to however many seconds you want your next
frame to kick in on. So ever second set it to 1, every 2 seconds set it to
2 etc.

However Z said that this will also work for half seconds but i am finding
it doesnt? How can i use a similar equation so that i can move to my next
frame in the animation every 0.5 seconds?

Z have i done something wrong here? If i set x to 0.5f my anim gets stuck.
(e.g. never results in 1)

Thanks





.



Relevant Pages

  • Re: Fade into a Picture Box or Image Control
    ... Joe users old P3 only manages to draw a couple of frames a second and the same animation takes forever. ... Dim StartTime As Long, EndTime As Long, TimeNow As Long ... Where DrawFrame() draw the frame at the given opacity, I prefer doing this rather than cluttering the animation loop ...
    (microsoft.public.vb.winapi.graphics)
  • Re: Sagnac Threads United
    ... I've made minor internal changes to my animation. ... My animation is NOW for a large rotating ring. ... nature of those 'apparent' motions in YOUR ROTATING frame. ...
    (sci.physics.relativity)
  • Re: How do I generate an animated pdf file from xfig/metapost
    ... I will post the source code below for an animation that ... I've done which illustrates how an ellipse is constructed. ... This PDF will have each frame of the ... Draw the ellipse dashed ...
    (comp.text.tex)
  • Re: Flashing a sprite
    ... you've reached the end of the animation, in which case frameIndex would go ... I guess the 2 would be my amount of seconds....but after gametime ... frames display frame 0, x amount of frames display frame 1" etc... ... you could just make a 2-frame animation for your flashing sprite. ...
    (microsoft.public.win32.programmer.directx.managed)
  • Re: Timing issue
    ... control the speed of animation of another object. ... on a time basis rather than frame basis, which i agree with so that even ... Microsoft DirectX MVP ... not reflect the official views of the Microsoft Corporation. ...
    (microsoft.public.win32.programmer.directx.managed)