Relationship between mesh and submesh in ogre

Source: Internet
Author: User

Entity is an instance of an object that can be moved in a scenario. It can be a car, a person, a dog, etc. entity is in the world) A fixed coordinate position is not required in the scenario.

An entity is based on a grid (Meshes). A mesh object contains a set of data used to describe its own model. Within a wide area (World scale, mesh objects are relatively small. Multiple entities can share a grid. For example, you often create multiple copies of the same object in a scenario.

You can create an entity by calling the scenemanager: createentity method, name the entity, and rename the mesh associated with the object) object Association (for example, "muscleboundhero. mesh "). Scenemanager loads the mesh for you through the resource manager such as meshmanager, and each type of mesh is loaded only once.

Only when you associate an entity with a scene node (scenenode) Will the entity become part of the scenario. By associating different entities to scenenodes, you can create a complex inheritance relationship between entities and directions. You can change the location of the associated entity by modifying the location of the scene node (scenenodes.

When a mesh is loaded, the material (Materials) data related to the mesh is also loaded. A mesh can contain material data because different parts of a mesh may use materials ). Any entity created on the mesh will automatically use the default material (Materials) used on the mesh ). Of course, you can also assign different textures to these same entities ).

To understand how to assign different textures (textures), you must first understand that all mesh objects are actually composed of submesh objects, each of which is submesh) represents a part of a mesh object, which can only use one material (meterial ). If a mesh uses only one material (material), it may only contain one submesh ).

When an entity is created based on a mesh, the entity may be constructed from multiple child entities (subentity), subentity and mesh) the submesh in is one-to-one. You can obtain subentity by calling entity: getsubentity ). Once you get the subentity pointer, you can call the setmaterialname method to change its material (material ). In this way, you can change the default material (Materials) of the entity you create to make the entity you create different.

Original article: http://www.cnblogs.com/lizhengjin/archive/2010/11/01/1866023.html

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.