[xoreos-devel] KotOR animations

Bardot Jérôme bardot.jerome at gmail.com
Sun Aug 27 14:00:30 CEST 2017


About the texture,
i think you do a wrong modification which change the global size like
your translation is different for each part which create a scaling algo

Check you do your modification in the right order (translation first and
scaling if needed after).

I'm not too much time today to look all the code.
Sry for my en … i quite tired today

i also send your email to a friend which is better than me in graphical
computing.

27/08/2017 à 13:16, Vsevolod Kremianskii a écrit :
> It's all here <https://github.com/xoreos/xoreos/pull/159/files> or you
> could use this
> <https://github.com/seedhartha/xoreos/tree/kotoranim3> branch.
>
> b there is a float array of MDX bone data.
>
> For every vertex there are 8 float values, four of which are bone
> weights, four are bone identifiers (or -1 if no bone is used). Weights
> are normalized.
>
> P.S. Already fixed skeleton falling through the floor
>
> 2017-08-27 18:01 GMT+07:00 Bardot Jérôme <bardot.jerome at gmail.com
> <mailto:bardot.jerome at gmail.com>>:
>
>     Can you send more code ? (a paste)
>
>     what is your b ?
>
>
>
>     Le 27/08/2017 à 10:26, Vsevolod Kremianskii a écrit :
>>     Alright, it works. Sort off. Except for that ugly mesh
>>     deformation issue. I wonder if somebody could set me in the right
>>     direction from here.
>>
>>     Here's how it's done:
>>
>>     I load position and orientation controllers for every animation
>>     node, which pretty much does it for the skeleton (also heads,
>>     since they're attached to the headhook).
>>     I load bone mapping from skin mesh header and per vertex bone
>>     data from MDX (as described here
>>     <https://github.com/xoreos/xoreos-docs/blob/master/specs/kotor_mdl.html>).
>>     When animation gets updated I iterate through model's skinned
>>     nodes and for every vertex do the following:
>>
>>     I iterate over nodes (bones) that affect the vertex and create
>>     each node's global transformation matrix (relative to the root
>>     node). Then I multiply initial vertex coordinates by the
>>     transformation matrix and multiply that by the bone weight.
>>     Resulting vertex coordinates are calculated as a sum of four
>>     transformed vertices. There are some optimizations in place so it
>>     isn't quite as bad as it sounds.
>>
>>      for (uint32 i = 0; i < vertexCount; ++i) {
>>      v[0] = 0;
>>      v[1] = 0;
>>      v[2] = 0;
>>      for (uint8 j = 0; j < 4; ++j) {
>>      int index = static_cast<int>(b[4 + j]);
>>      if (index != -1) {
>>      float rv[3];
>>      transform = transArr + (index * 16);
>>      transform.multiply(iv, rv);
>>      v[0] += rv[0] * b[j];
>>      v[1] += rv[1] * b[j];
>>      v[2] += rv[2] * b[j];
>>      }
>>      }
>>      v += stride;
>>      iv += 3;
>>      b += 8;
>>      }
>>
>>     Now, the problem is that weird stretching issue. I have no idea
>>     what could cause that at the moment.
>>
>>     <http://goog_555208919>
>>     https://yadi.sk/i/0hnd2a0M3MMYJR <https://yadi.sk/i/0hnd2a0M3MMYJR>
>>     https://yadi.sk/i/jdiTSrXZ3MMYL3 <https://yadi.sk/i/jdiTSrXZ3MMYL3>
>>     https://yadi.sk/i/Vm3kRTVf3MMYKQ <https://yadi.sk/i/Vm3kRTVf3MMYKQ>
>>
>>
>>
>>     _______________________________________________
>>     xoreos-devel mailing list
>>     xoreos-devel at xoreos.org <mailto:xoreos-devel at xoreos.org>
>>     https://xoreos.org/mailman/listinfo/xoreos-devel
>>     <https://xoreos.org/mailman/listinfo/xoreos-devel>
>
>
>
>     _______________________________________________
>     xoreos-devel mailing list
>     xoreos-devel at xoreos.org <mailto:xoreos-devel at xoreos.org>
>     https://xoreos.org/mailman/listinfo/xoreos-devel
>     <https://xoreos.org/mailman/listinfo/xoreos-devel>
>
>
>
>
> _______________________________________________
> xoreos-devel mailing list
> xoreos-devel at xoreos.org
> https://xoreos.org/mailman/listinfo/xoreos-devel


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://xoreos.org/pipermail/xoreos-devel/attachments/20170827/3d3a41ff/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0x03878A98.asc
Type: application/pgp-keys
Size: 3098 bytes
Desc: not available
URL: <http://xoreos.org/pipermail/xoreos-devel/attachments/20170827/3d3a41ff/attachment.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://xoreos.org/pipermail/xoreos-devel/attachments/20170827/3d3a41ff/attachment.asc>


More information about the xoreos-devel mailing list