About Store Forum Documentation Contact
Donations:
345$/mo



Post Reply 
Vertex skinning
Author Message
JayJay Offline
Member

Post: #1
Vertex skinning
Model B is a copy of model A except that some vertices were slightly moved to a nother position (but no face, edge or vertex was deleted or added). A skeleton was added to model A using the model editor.

Is it possible to map the vertex skinning of model A to model B?
How is the vertex-skinning-data stored? Can I access the vertex-skinning-data in C++?

Thanks in advance!
(This post was last modified: 08-18-2011 02:55 PM by JayJay.)
08-18-2011 02:49 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #2
RE: Vertex skinning
Is it possible to map the vertex skinning of model A to model B?
no

Can I access the vertex-skinning-data in C++?
yes, check meshbase headers
08-18-2011 03:45 PM
Find all posts by this user Quote this message in a reply
JayJay Offline
Member

Post: #3
RE: Vertex skinning
Thank you Esenthel.

If someone wants to do something like this:
The easiest way in C++ to copy all data from model A to model B except vtx-positions (or what ever):
1) create a copy C of mesh A
2) replace the vtx-positions (or what ever you want) of C with the ones of B
PHP Code:
for (int j 0to->parts.elms() && from->parts.elms(); j++)
{
    for (
int k 0to->parts[j].base.vtxs() && from->parts[j].base.vtxs(); k++)
    {
        
// copy the position
        
to->parts[j].base.vtx.pos(k) = from->parts[j].base.vtx.pos(k);
    }
      
// recalculate vertex normals
    
to->parts[j].base.setNormals();

3) replace B with C

It's that easy. Note that this just works if model B is a copy of model A except that some vertices were slightly moved to a nother position.
(This post was last modified: 08-19-2011 01:17 PM by JayJay.)
08-19-2011 01:09 PM
Find all posts by this user Quote this message in a reply
Post Reply