Skip to main content
gamedev.net
🔒 Locked

Is this how keyframing works?

Started by AcidJazz Oct 28, 2002 at 10:10 AM 3 replies 1.3k views
Original Post
AcidJazz
AcidJazz
Basically you store a certain number of frames for a certain animation then you go through them a fraction at a time? So for example if I had 100 vertices and 10 frames for lets say a person walking and 30 frames per second and it took 3 seconds to get through an entire walk cycle. I''d have to go 1/9th of the way for each x, y, z, between frame 1 & 2 right? However that''s a linear equation which has to cause some error, are there more accurate ways of doing this? Am I even thinking about this the proper way? If you know any articles on key framing (or other methods of 3D animation) send em this way =) Thanks a lot
Why is 99% of the Comp Sci population guys, and the other 1% not female? ;/
Waverider
Waverider
Well, you may want to provide the ability to vary the amount of time between frames (that is, each frame has its own duration).

I had a character that used a run cycle with only 4 keyframes. the keyframes with the feet coming forward were long, and the step-down keyframes were fast, making it look more realistic.
It's not what you're taught, it's what you learn.
simbobx
simbobx

You don''t have to use linear interpolation between frames .. you can use splines if you prefer (tho note that afaik splines need four control points not the two (start+end) which linear interpolation will use, so you''ll need a way to get/generate these. Not sure, but usually the previous & next frames in line are used).

Linear interpolation: use this frame + next frame
Spline : use last, this, next and next again.

nb: E&OE. I''ve never actually done this myself
Zorodius
Zorodius
quote:
Originally posted by AcidJazz
Basically you store a certain number of frames for a certain animation then you go through them a fraction at a time?

Yep.

As far as I know, keyframing is normally done with linear interpolation and all frames considered to be the same amount of time apart. At least, that''s how I did it when I implemented a .MD2 viewer. Waverider''s suggestion would be a great way to save some space.

I don''t think using something besides linear interpolation would give a noticable improvement in the quality of the animation, but it would probably take a lot more processor time to do. Maybe it would be worth it if your frames were a long time apart, though.
You don't need to vote for the "lesser of two evils"! Learn about Instant Runoff Voting, the simple cure for a broken democracy!
Rian
Rian
Because linear interpolenation is linear, vertices will only move in straight lines between keyframes. This is usually not a problem, though, because it happens too quickly for us to notice.
I can imagine a world without hate, a world without fear, a world without war. And I can imagine us attacking that world, because they would never expect it. -Jack Handy

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.