Horde3D

Next-Generation Graphics Engine
It is currently 28.04.2024, 09:18

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: 07.08.2011, 23:21 
Offline

Joined: 01.08.2011, 19:54
Posts: 5
What is the best way of handling paper-doll style animation? ie, setting up an animated entity that can be customized with different meshes for bits of equipment, as in an RPG? I currently have tried setting up a base model node then adding the component pieces as children of the node, but while they receive the node transformations of the parent node they are not attached to the animated skeleton that is attached to the parent node, so only the base mesh is animated. How exactly do I ensure that these added component meshes are attached to the parent node skeleton?

Obviously, I could call h3dSetupModelAnimStage on each of the child meshes, but this seems like it would setup an animated skeleton for each model, rather than having the models share a skeleton, requiring redundant calculations and also requiring that I call h3dSetModelAnimParams for each individual mesh, rather than just the parent mesh.


Top
 Profile  
Reply with quote  
PostPosted: 09.08.2011, 09:50 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
Unfortunately there is no way to share a skeleton between different model instances at the moment but that is definitely something to be added for the future.

I guess for now workarounds as the one you proposed are the only option. A different approach can be to add all item meshes to the base model and hide the ones that are not used. This might not fit nicely into a very modular item system though.


Top
 Profile  
Reply with quote  
PostPosted: 11.08.2011, 00:12 
Offline

Joined: 01.08.2011, 19:54
Posts: 5
If I wrote a tool script that compiled all of the component base meshes into a single geometry resource with an associated index table as far as where each base mesh's indices and vertices begin and end, I could add and remove Mesh nodes to the Model to perform the component swapping. Given that I'm indie and I create my own artwork, I certainly wouldn't have so many base meshes per component to make this a memory-size issue, so this might be a valid approach.

One question that I have regarding this is the issue of software skinning. Even though I use hardware skinning, conceivably there may be a situation where I might have to do software skinning. If this were the case, would the entire geometry resource be transformed by the animation (including parts that are not referenced by any currently set Mesh node), or would the skinning be done on a Mesh basis?

Also, is there a format spec for the geometry resource format, or should I just go source diving to puzzle it out?
EDIT: Nvm on the last, found the spec in the docs. >.>


Top
 Profile  
Reply with quote  
PostPosted: 12.08.2011, 17:49 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
This looks like a viable approach. Regarding the software skinning, right now all vertices in the geo resource are processed. However, this could certainly be optimized if it turns out to be a bottleneck.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 30 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group