1 registered members (TipmyPip),
18,574
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Animation Frame based on distance
#187261
03/06/08 09:46
03/06/08 09:46
|
Joined: Apr 2002
Posts: 1,246 ny
jumpman
OP
Serious User
|
OP
Serious User
Joined: Apr 2002
Posts: 1,246
ny
|
hey everyone,
I wanted to know if anyone would know how to go about doing this in c-script. Say I have an animation, maybe of a model opening its mouth made in 10 frames. I have a distance value between 2 points. If the distance value is say at max 300, I need a formula that will put the animation of the model at the 10th frame, based on the distance value. So:
If the distance value is at 0, the animation is at frame 0. If the distance value is at the 300 max, the animation is at frame 10.
What formula could I use so that any distance between 0 and 300 would correlate to a frame of animation? Can the formula accomodate different total frames of animation and different max distances?
Last edited by jumpman; 03/06/08 10:37.
|
|
|
Re: Animation Frame based on distance
[Re: dinosaur]
#187264
03/06/08 18:20
03/06/08 18:20
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
@Dinosaur
c-script takes care of type casting for you, so you don't have to worry about all the mess. Also, ".frame" accepts fractions as well (for interpolating), so converting to integer isn't necesary...
xXxGuitar511 - Programmer
|
|
|
|