Mesh current animation frame - B3D

Blitz3D Forums/Blitz3D Programming/Mesh current animation frame - B3D

semar(Posted 2009) [#1]
Hi Blitzers,
how can I get the current animation frame of an animated .B3D model ?

Suppose this scenario: I have a 3D model of a guy launching a frisbee.

I would like that the frisbee is released at a specific frame of the whole animation.

How can I achieve that ? I need the current animation frame, but as far as I know, I didn't find any command in the Blitz3D docs.

Thanks in advance,
Sergio.


PowerPC603(Posted 2009) [#2]
Are you using tweening?

If not, you could use a counter in your mainloop to count the frames.
And release the frisbee when the counter hits a certain value (so he'll release the frisbee after some predefined number of frames).

Of course, you need to reset the counter to 0 when the animation sequence starts and increase the counter every frame if the character is doing the animation for throwing the frisbee.


neoshaman(Posted 2009) [#3]
AnimTime# ( entity )

Parameters:

entity - entity handle
Description:

Returns the current animation time of an entity.


semar(Posted 2009) [#4]
Thanks folks - AnimTime is exactly what I'm looking for - by the way, in my opinion it should be renamed to AnimFrame instead :)

Cheers,
Sergio.


Tom(Posted 2009) [#5]
Not AnimFrame because if you're using tweening, your animated mesh won't necessarily be exactly on an integer key frame.

A frame is just a quantification of time :)


semar(Posted 2009) [#6]
Ah I've got it now, thanks Tom :)


GIB3D(Posted 2009) [#7]
Well in my opinion it should be GetAnimTime seeing as there is a SetAnimTime command.