SetAnimKey

Blitz3D Forums/Blitz3D Beginners Area/SetAnimKey

Sir Gak(Posted 2005) [#1]
I'm looking to do some simple animations within the Blitz3D command set, using the SetAnimSet and AddAnimSeq (and related) commands. The example given in the docs is not quite clear enough to me. I want to typically do double animation sets for things.

For instance, I want to pull a lever, and a door swings open as a result. The animation would cover both objects moving simultaneously. This means, as the door lever is pushed up, the door swings open on its hinges. Likewise, when the door lever is pulled down, the down swings shut. The whole moving up-lever and door swinging is one animation, the lever down and door closing is another (hmm, actually as I understand things, if the animate speed is set to negative, it runs the anim backwards, which would do the trick nicely.

Or, with another example of double animation sequences, I would want to have one anim for a foe moving (ie walk, run, crawl, fly, etc), and then as a separate animation, that foe attacking (swing weapn, bite, claw, magic spell, etc).

Does anyone have any examples that would make this clearer, in how to use the built-in Blitz3D anim commands?

Has anyone used the Blitz anim commands at all, and maybe could give a better illustration? Thanks.


Sir Gak(Posted 2005) [#2]
Anybody want to take a crack at this, or is nobody actually USING these anim commands within Blitz3D?


Rob Farley(Posted 2005) [#3]
Can't be done, you need to trigger both sets of animation. Surely when you have the trigger 'player pressed lever' you simply run the animation for the door and lever. Animation is applied per entity. If however, you have the lever and door as one model it wouldn't be a problem.

With your second example, I'm guessing you're talking about having the torso doing one thing and legs doing another? If this is the case this can't be done either.

However...

You can manually adjust positions of bones after you have done the updateworld so if you roll your own animation you can do this.

The other way of course is have the torso and legs as seperate models like quake 3 and simply have a different bunch of animations for each model.

Another way of dealing with animation is to have a null model so to speak which is just the animated skeleton, then you pose the null model however you want and then assign the bone positions and rotations to your proper model, this way you could have 2 null models doing different things and you take bone positions from the upper half of one and the lower of the other.

To answer you other question, yes, many many people including myself all use the blitz animation commands.


Sir Gak(Posted 2005) [#4]
I have a doorframe, into which I insert a door. The doorframe is the parent, and the door the child. I was thinking of not only making the doorframe the door's parent, but also the lever's parent as well.

To move the lever and thereby trigger the door to open, I could have two animations, one for the lever and one for the door. If I understand you aright, there's no reason that I can't call one animation after the other sequentially, right? By that, I mean, I am assuming that the animation, once triggered/set into motion, runs autonomously, in that I call the lever animation, and as the lever starts moving, the door animation immediately follows and opens the door.

Now, I can do other stuff as the animations are running, right? (i.e. I'm not stuck waiting for the animation to complete, like being in a For-Next loop , waiting for it to run its course, correct?) Example, if the game's hero/knight opens a door, and he knows a fiend is on the other side, he can activate the lever to open the door, and while the door is still moving, back away from the moving door. That's what I mean by autonomous.

As for the movement/attack animation pairs, my program logic could determine which is occurring, and run the appropriate animation (ie one animation for when the skeleton moves up to the hero/knight, then when the skeleton is within range, switch to an attack animation to get the skeleton to swing a weapon at the knight), so it's really two separate animation sequences.

As for your using all the blitz animation commands, do you have any examples of your work that I could look at? It might help me better understand these commands.

Thanks.


Ricky Smith(Posted 2005) [#5]
This may help :
http://www.blitzbasic.com/codearcs/codearcs.php?code=660


Sir Gak(Posted 2005) [#6]
Thanks. I'll have a look at it.