Share anim betw. meshes + combining meshes on the fly

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
KingPrawnVindaloo
Greenskin
Posts: 100
Joined: Mon Apr 18, 2005 11:05 pm
Location: Kent, UK
Contact:

Share anim betw. meshes + combining meshes on the fly

Post by KingPrawnVindaloo »

Hi All -

I've been away a bit, reading a lot and thinking about what next to work on - now, I'm back and ready to start asking some really stupid questions again! The idea is to make a football game. I mean, soccer. No - I mean football. :P

OK - say I design a player mesh, and create a skeleton, bind the mesh to the skeleton and animate it. Fine. What if, then I want to later on create additional meshes to create some variation, I take it I can re-use the skeleton for that mesh too.

Is there anything I need to bear in mind? I've read in other posts that this is possible, but how does the skeleton know which vertices to influence on the other mesh without skinning that too? Or am I missing something really simple. Are there any limitations to think about, such as number of vertices per mesh or anything like that?

Also - I want characters in my game to follow the flight of the ball with their head. This will need to be parametrically set on the fly. I take it the way to do that would be to have a head bone on the skeleton that can be manipulated programmatically as required.

But, again, to create variation and recognition within the game, I would want different heads to be on the basic model. I realise this can be done with textures, but they need to be quite distinct and recognisable and although in early iterations of the game I won't need this ability, planning ahead I'm thinking of having different meshes for each head.

Would there be a way to seamlessly 'stitch' the head/neck to the body? I realise I could hide this underneath, say, armour, but as I'm planning a sports game, open-necked shirts are the order of the day. I won't need to go to the lengths of randomizing arms, legs etc - just the heads.

I know I can access the vertex buffer somehow and push vertices in there, but I'll need to play a bit more with that. Think that's the way to go? Is there a way of tagging vertices or anything like that so I know which vertex I'm lining up? I'm guessing here.

I appreciate any feedback - I'm thinking hard and planning all sorts of stuff before I start so I know exactly what I'm in for.

Ta
User avatar
ahmedali
Gnome
Posts: 302
Joined: Fri Feb 20, 2004 8:52 pm
Location: Lahore, Pakistan

Post by ahmedali »

There are "many" combinations and schemes by which you can add variation. Sine I use 3dsmax and many of the issues are 3Dapp&exporter related.

Sharing Skeleton
-In a 3d app like 3dsmax you can reuse a skeleton. But for any new mesh you to apply skin mod. Or in other words each mesh has its own vertex wright table for the skeleton.

-Make sure that skeleton remains unchanged and all the animation files have same initial pose. But i think you can safely scale the bones but dont change their pos/rotation.

Sharing Weight Table
, but how does the skeleton know which vertices to influence on the other mesh without skinning that too
-It depends upon your 3d app. In 3dsmax you can do changes in mesh under skin modifier but that may cause side-effects (depend upon the type and magnitude of change). Specially if you have manually setted the vertex weights.

-Also i think you can copy the skin modifier to other meshes.

Sharing Animation
-Of course you need a common skeleton to share animatin. I think in Ogre, it is possible to scale bones of the skeleton to suit different size meshes and use the same animation set b/w them.

Variation by Material/Texture
Ofcourse you use different materials and textures for different parts of bodies and simply switch them for change.

Variation by different Mesh for a body part
If you want to use a common mesh body but you a set of different Head meshes to attach to, then its possible. But it depends upon how you are doing to acheive that in your 3d app. In 3dsmax its pretty straight farword. And to avoid the seams at neck or head joint, just keep the weights of vertice same.

I hope that helped. Do some practical tests for you scheme before starting the project. To make things simple just use variation by material and texture, since player will be mostly viewing from birds eye view. And as the gameplay will be fast, players will may not notice them. And this will also save a LOT of time of your team.
Post Reply