Adding role animation in virtual 3D scenarios

Source: Internet
Author: User
Adding dynamic characters to virtual 3D scenes is the basic requirement for virtual community construction and 3D games. Before achieving this goal, it is necessary to analyze the characteristics of the role and describe their respective ways of implementation.
Character role features and implementation methods in virtual 3D scenarios:
1) Being able to truly reflect human actions in the real world, and be able to combine these different actions, such as walking and watching. This feature can be achieved through the skeleton animation, because this type of model is a skeleton structure composed of interconnected "Bones", which can be generated for the model by changing the orientation and position of the skeleton.

2. This feature can be achieved by combining physical model packages, such as ode and pal.

3) Create and import dynamic character models into the scene accurately. Models can be created using creator, 3 DMAX, Maya, and other modeling software. To import the created character model to a virtual scenario, you need to find the underlying similarities between the two types of models. Generally, the format of the texture file is similar, and find the common location of the geometric file, it is likely to be traced back to the numerical matrix or even the vertex pair position. For example, the main code for loading the character model file is:
For (unsigned int I = 0; I <mbodynode-> getnumchildren (); I ++)

{
OSG: matrixtransform * scale = dynamic_cast <OSG: matrixtransform *> (mbodynode-> getchild (I); // obtain the Matrix

For (unsigned Int J = 0; j <scale-> getnumchildren (); j ++)

{

OSG: geode * geode = dynamic_cast <OSG: geode *> (scale-> getchild (j); // get the child node

For (unsigned int K = 0; k <geode-> getnumdrawables (); k ++)

{// Obtain the basic element
OSG: drawable * drawable = dynamic_cast <OSG: drawable *> (geode-> getdrawable (k ));

}

}

}
..........
Return mbodynode. Get ();
4) The motion amplitude of the dynamic character model changes. You can set the position and size of the character model by setting the transformation matrix at the top of the entire model data organization. In addition to the corresponding changes in the movement of the skeleton animation, the changes in the running and other amplitude are also amplified by parameters such as the translation in the transformation matrix.

Figure:

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.