Skip to main content

A Simple Framework for Animated Models

Submitted by WiffleCube on
Forum

I'm trying to work out a simple structure for holding and sending
animation frames i.e. a mob - mobile object.

Here's what I've come up with so far, any ideas would be appreciated:

Basic animation with perhaps interpolation of vertices would be a good start.
The docs seem scant on the .x animation format but I'm persevering. The
idea is that the scenery is BSP (implemented), then movable and mobile
objects are not.

The mobile objects need to be animated. Here is my plan:

Frame: 0 1 2 3 4 5 6 7 8 9 10

Say do <0,1,2,3> for state: walking.
<4,5,6,7> state: melee fighting.
<8,9,10> state: firing gun.

Each set would loop around. I'm not sure of how interpolation features
are accessed yet, but it would be good to interpolate between frames.

Skeletal animation would be good, but as this is my first venture into
3D games perhaps I'll leave it for the future. My main obstacle at the
moment is digging the animation information out of the .x format.

Submitted by davidcoen on Tue, 21/12/04 - 12:53 AM Permalink

the text mode of .x format with animation enable in the export (and frames/bones enabled) was just a matrix for each frame/node per keyframe... (when i wanted to read this, a simple text parser was sufficeint)

for what you are describing (a series of 'statue' animations) you could just have a .x file of the geometry for each frame, and 'lerp' between two of these geometries for the current animation. perhaps having a custom vertex format with seperate vert_translation into which you can place the 'lerped' vert pos (the uv info wouldn't change, and would be tempted not to change the normals either, just leave them in the original object space, since if it is animating, you may not notice them not reorientate--- movement covers a lot of things)

hope some of that made sence

Submitted by WiffleCube on Tue, 21/12/04 - 10:15 AM Permalink

quote:Originally posted by davidcoen

the text mode of .x format with animation enable in the export (and frames/bones enabled) was just a matrix for each frame/node per keyframe... (when i wanted to read this, a simple text parser was sufficeint)

for what you are describing (a series of 'statue' animations) you could just have a .x file of the geometry for each frame, and 'lerp' between two of these geometries for the current animation. perhaps having a custom vertex format with seperate vert_translation into which you can place the 'lerped' vert pos (the uv info wouldn't change, and would be tempted not to change the normals either, just leave them in the original object space, since if it is animating, you may not notice them not reorientate--- movement covers a lot of things)

hope some of that made sence

Yes it did, and thank you.[:)]

I've been haranguing people on flipcode for close to a month for that info. So I'll make a new vertex structure with a 'scratch' vertex which is constantly changing according to where it is in the lerp. Great. And I'll be able to get the frames from the .x file.

The animation framework for DirectX is there, but docs are scant (I've been searching everywhere). I'm not sure how to access the lerping functions (although I know they exist). I'm hoping the animation using this method will emulate Thief I, using ellipsoid collision objects for humanoids. If that would require more than this method (e.g. skeletal anim.) then i'll stick with this.

EDIT: There is a screenshot of the demo in General Discussion.

Best Regards,
WiffleCube/Heddwyn

Posted by WiffleCube on
Forum

I'm trying to work out a simple structure for holding and sending
animation frames i.e. a mob - mobile object.

Here's what I've come up with so far, any ideas would be appreciated:

Basic animation with perhaps interpolation of vertices would be a good start.
The docs seem scant on the .x animation format but I'm persevering. The
idea is that the scenery is BSP (implemented), then movable and mobile
objects are not.

The mobile objects need to be animated. Here is my plan:

Frame: 0 1 2 3 4 5 6 7 8 9 10

Say do <0,1,2,3> for state: walking.
<4,5,6,7> state: melee fighting.
<8,9,10> state: firing gun.

Each set would loop around. I'm not sure of how interpolation features
are accessed yet, but it would be good to interpolate between frames.

Skeletal animation would be good, but as this is my first venture into
3D games perhaps I'll leave it for the future. My main obstacle at the
moment is digging the animation information out of the .x format.


Submitted by davidcoen on Tue, 21/12/04 - 12:53 AM Permalink

the text mode of .x format with animation enable in the export (and frames/bones enabled) was just a matrix for each frame/node per keyframe... (when i wanted to read this, a simple text parser was sufficeint)

for what you are describing (a series of 'statue' animations) you could just have a .x file of the geometry for each frame, and 'lerp' between two of these geometries for the current animation. perhaps having a custom vertex format with seperate vert_translation into which you can place the 'lerped' vert pos (the uv info wouldn't change, and would be tempted not to change the normals either, just leave them in the original object space, since if it is animating, you may not notice them not reorientate--- movement covers a lot of things)

hope some of that made sence

Submitted by WiffleCube on Tue, 21/12/04 - 10:15 AM Permalink

quote:Originally posted by davidcoen

the text mode of .x format with animation enable in the export (and frames/bones enabled) was just a matrix for each frame/node per keyframe... (when i wanted to read this, a simple text parser was sufficeint)

for what you are describing (a series of 'statue' animations) you could just have a .x file of the geometry for each frame, and 'lerp' between two of these geometries for the current animation. perhaps having a custom vertex format with seperate vert_translation into which you can place the 'lerped' vert pos (the uv info wouldn't change, and would be tempted not to change the normals either, just leave them in the original object space, since if it is animating, you may not notice them not reorientate--- movement covers a lot of things)

hope some of that made sence

Yes it did, and thank you.[:)]

I've been haranguing people on flipcode for close to a month for that info. So I'll make a new vertex structure with a 'scratch' vertex which is constantly changing according to where it is in the lerp. Great. And I'll be able to get the frames from the .x file.

The animation framework for DirectX is there, but docs are scant (I've been searching everywhere). I'm not sure how to access the lerping functions (although I know they exist). I'm hoping the animation using this method will emulate Thief I, using ellipsoid collision objects for humanoids. If that would require more than this method (e.g. skeletal anim.) then i'll stick with this.

EDIT: There is a screenshot of the demo in General Discussion.

Best Regards,
WiffleCube/Heddwyn