Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / How do I blend animation smoothly between two keyframes?

Author
Message
Bulleyes
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 19th Oct 2003 06:10
How do I blend animation smoothly between two keyframes? For example, the character in my game have a three poses, which is in three keyframes:

Pose #1: Idle
Pose #2: Left Arm Raise up
Pose #3: Right Arm Raise up.

What I wanted to do is, whenever my character is in pose #2 or pose #3, I want it goes back to pose #0. I know I can use SET OBJECT FRAME to switch to that keyframe, but this will result a sudden jerkiness in the animation. Of course I can add more animation data to animate smoothly from pose #2 and pose #3 to pose #1, but I wanna avoid this if possible.

The most feasible choice is to linear interpolate from one keyframe to another. This shouldn't be that hard if I have to access to the underlying transformation matrix of each bone. But alas, DBpro doesn't provide those low level functions.

Any ideas? Thanks in advance.

Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/
Ian T
23
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 19th Oct 2003 07:40
Set Object Interpolation might help. Other than that, you really need more keyframes in your animation

--Mouse: Famous (Avatarless) Fighting Furball

A very nice %it, indeed.
indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 19th Oct 2003 08:02
what about having a spot in the arm position that you play the animation backwards to. from this point in time u jump to the playing forward of the new animation

eg:

frames 2- 30

arms by side

arm raised half way

arm rasied fullextension

arm rasied halfway but reversed play

arm by side


then jumping to the next animation which starting frame is by the side.

31 - 60

arm does something different.

Bulleyes
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 19th Oct 2003 10:00
@Mouse
I heard SET OBJECT INTERPOLATION is somehow buggy, am I right? Correct me if I was wrong.

@indi
That's something that I wanna avoid whenever possible. As DBpro doesn't allow programmers to combine animations. If I were to follow your way, I need to have all possible combination of animations, for example, if my character can raise his left/right arm up/down, and can also raise his left/right leg up/down, I will have a total of animation

- Left Arm Down, Right Arm Down, Left Leg Down, Right Leg Down (or we called it idle pose.)
- Left Arm Down, Right Arm Down, Left Leg Down, Right Leg Up
- Left Arm Down, Right Arm Down, Left Leg Up, Right Leg Down
- Left Arm Down, Right Arm Down, Left Leg Up, Right Leg Up

- Left Arm Down, Right Arm Up, Left Leg Down, Right Leg Down
- Left Arm Down, Right Arm Up, Left Leg Down, Right Leg Up
- Left Arm Down, Right Arm Up, Left Leg Up, Right Leg Down
- Left Arm Down, Right Arm Up, Left Leg Up, Right Leg Up

and so on... (16 combinations in total.)

Think of it... if we can interpolate animation between keyframes, then we can cut down half of the animations.

Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/
indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 19th Oct 2003 10:14
you could do some animations with code. eg: rotate limb and a sine curve would work as this is how I was making my beasts gallop around the landscape. not very workable for some more complex animations unless you wanted to develop your own animated system.


If append object is currently broken I cant imagine it to be so forever so perhaps this work should wait until its resolved.

Bulleyes
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 19th Oct 2003 17:02
Agree! Without the ability of blending animation, it is totally impractical to create all possible animation combinations in my character. I mean, this is really nuts.

Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/
Ian T
23
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 20th Oct 2003 18:39
Interpolate seems to work well for me, but I use objects with roughly 20 keyframes to each animation, so it's not a big deal in my case. I do hope this is fixed soon.

--Mouse: Famous (Avatarless) Fighting Furball

A very nice %it, indeed.
Bulleyes
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 20th Oct 2003 18:58
@Mouse

Do you really mean SET OBJECT INTERPOLATION works? Any code snippets? Thanks!

Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/

Login to post a reply

Server time is: 2026-07-26 09:29:29
Your offset time is: 2026-07-26 09:29:29