Further Optimization of bone data

Source: Internet
Author: User

The reason is to see this articleArticle:

Http://www.cnblogs.com/ixnehc/archive/2010/12/12/1903662.html

This section inspired me:

During the specific compression, we also adjusted the compression precision of different parts of the bones. The closer the root of the bones, the stricter the error restriction, to avoid the movements, the skeleton at the end of the skeleton (such as the wrist and ankle) can be relaxed. 

Previously, the precision control was fixed:

Float Epsilon = Powf ( 0.1f , Static_cast < Float > (Config. Precision )); // Precision

ThereforeCodeChanged:

 

Int Depth = STD: min ( 10 , Getnodedepth (pbone ));
Const   Float Maxprecision = Config. Precision - Min_precision +   1.2f ;
Float Factor = STD: max ( 1.0f , Maxprecision * ( 1.0f   -   1.0f   / Depth ));
Epsilon = Powf ( 0.1f   * Factor, static_cast < Float > (Config. Precision )); // Precision
Optimizeskeletal (epsilon, bone. keyframes );

 

Note:

Getnodedepth is used to obtain the depth in the skeleton where the skeleton is located.

Maxprecision is used to control the maximum variation.

Factor controls the final precision. The larger the bone depth, the closer the factor is to maxprecision.

 

In this way, we can observe that maxprecision = 1.2 is a suitable value, and the animation will not be too affected. The final skeleton data can be reduced by about 0.2-0.5 (compared with the previous one ).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.