Source code Analysis of Second Life (14) Realization of Personas

Source: Internet
Author: User

In the second life, the most important realization is the realization of personas, it is not based on the first perspective, but the third perspective of the way to achieve, so each inhabitant in the second Life is a virtual Persona representative. This structure of the society is colorful, first take a look at the following characters image:

Cai Junsheng 2008/01/14 qq:9073204 Shenzhen

Cai Junsheng 2008/01/14 qq:9073204 Shenzhen

From the above, see all kinds of characters, wearing different clothes, posing different posture, various forms. To achieve such a persona display, more code is needed to achieve this. First of all, its grid is more complex, there are many triangles to construct such a complex figure, just the head of the triangle grid size, there are 1.6M size. Second, its skeleton animation is also more complex, these require a large number of transformation matrix composition. Again, is to achieve a lot of characters at the same time the calculation of a large amount. The process of implementing personas is to load the hair, eyes, head, upper limb, and lower extremities before pasting the corresponding texture picture.

In the second Life, in order to speed up the display of characters, and did not put the figures of the grid data on the server, but with the client to download together. Now let's analyze how to load the grid data from the file. As follows:

1. Llvoavatar::llvoavatar () constructor

Initialize personas.

2, Buildcharacter ();

Constructs a persona.

3, Loadavatar ();

Loads the persona.

4, Loadmeshnodes ()

Load the character's grid node.

5, Llpolymesh::getmesh (Info->mmeshfilename);

Loads the role's data by name.

6, Mesh_data->loadmesh (Full_path)

Reads the grid data from the file path name.

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.