Mailing List
Home
Forum Home
Softimage
Carrara
trueSpace
Dir3d-l
Maya - a powerful 3D animation and visual effects software
Macromedia Flash Development
Subjects
Cameras
scaleDown command
black out solved
Aircraft Tutorial
Mathematical XYZ ?
Its done This vs That
Its done first week
recommendations for screen video captures?
3DExplorer "Oddity "
New Director
ProTeam renewals
Fuel 's new websites (X post)
Blue peter create a make toy
targeting groups question
XPost: Shockwave 3D game ( sort of )
RES: RES: RES: Fish Modeling
Emitting particles from object intersection
Fuel 's new websites (X post)
Texturing
Big Break Contest Videos
New Plugins
Models and Texture on my updated site
Error Installing Patch tS6 6
Plasma?
Looking for Inspiration
Weird EMail Q
It 's done first week ?
Cherry not cranberry
New game
Camera Animation Problem
Particle plugins?
 
adjusting animation speed across machines (Jack)

adjusting animation speed across machines (Jack)

2004-01-29       - By Neto

 Back
Reply:     1     2  

My favourite way to move my time-based objects is to have a global called
"frameTime" or something.

Everyframe, before all other code is called, I fill it up with:

global frameTime, timeSinceLastFrame

frameTime = timeSinceLastFrame/1000.0
frameTime = max(frameTime, 0.1)
timeSinceLastFrame = the milliseconds

The second line is a safety check. It caps the 'frameTime' to 0.1 seconds,
so the game will limit the speedups to 10fps. If the game runs at 1 frame
per second, the game will work as if it were running at 10fps, to avoid
major jerkiness (but this is not recommended for multiplayer games).

Then, in the application itself, ALL speeds are in units-per-second. When
moving something I just do:

model.translate(direction*speed*frameTime)


-- -- Original Message -- --
From: "Paul Fortier" <pf@(protected)>
Cc: <dir3d-l@(protected)>
Sent: Thursday, January 29, 2004 1:12 PM
Subject: Re: [Dir3d-l] adjusting animation speed across machines (Jack)


> Thanks Jack. I was hoping not to have to do checking (if I could test
> *something else* about the machine before the walk sequence happened and
> adjust the playrate accordingly). But that might be what I must do.
>
> Do you mean I should use a timeout to move the character? What do you
> mean by 'last update'?
> Thanks,
> Paul
>
> Jack Kristoffersen wrote:
>
> >  Check time that has passed since last update and move accordingly. That
> >way your character will move the same distance independent of frame rate.
> >The playrate is already time based so you don't have to worry about that.
> >
> >
> >
> >  Jack.
> >
> >
> >
> >
> >
> >
>
>
> __ ____ ____ ____ ____ ____ ____ ____ ____ ____
> Dir3d-l mailing list
> Dir3d-l@(protected)
> http://nuttybar.drama.uga.edu/mailman/listinfo/dir3d-l
>

__ ____ ____ ____ ____ ____ ____ ____ ____ ____
Dir3d-l mailing list
Dir3d-l@(protected)
http://nuttybar.drama.uga.edu/mailman/listinfo/dir3d-l