Mesh properties [Unity]

Source: Internet
Author: User

Mesh is a component within unity, called a grid component. The 3D grid is the most important graphic element in unity. There are several components in unity that are used to render standard meshes or skinned meshes, trailing or 3D lines.

Within the unity-"component-" mesh component, there is mesh filter,text mesh, mesh render three subkeys. As you can see in the Holy Scriptures, there are four things:

      • Mesh Filter Grid filters
      • Mesh Renderer Grid renderer
      • Skinned mesh Renderer skin Mesh Renderer
      • Text Mesh textbox renderer

The more popular understanding is that mesh refers to the mesh of the model, and modeling is the construction of the grid. By examining mesh, you can know that the main properties of mesh include vertex coordinates, normals, texture coordinates, triangle drawing sequences and other useful properties and functions. Therefore, the grid is a triangle, the triangle is the positioning of three points.

The mesh filter contains a mesh component that can be used to obtain the component of the model grid based on Meshfilter, or to set the mesh content for Meshfilter.

Mesh render is the component used to render the mesh. Meshfilter's role is to throw mesh to Meshrender to show the model or the geometry.

Comb the content, presumably is the unity of the object is Gameobject, each gameobject can have a meshfilter component (also can not), the component has a mesh property (this must have), and this property has a ver affixed, A Vector3 array that stores the vertex information.

Mesh objects have properties for vertices and their associated data (normal and UV coordinates) and triangle properties. Vertices can be supplied in any order, but normal and UV arrays must be ordered so that the indexes correspond to vertices (that is, element 0 of the normal array provides normals for vertex 0, and so on). The vertex is Vector3, which represents the point of the object's local space. The normals are normalized Vector3, and once again represent the direction in the local coordinates. Uvs are specified as Vector2, but because the Vector2 type does not become a field of U and V, it is converted to x and y accordingly.

A triangle is specified as an integer tuple that acts as an index in a vertex array. Arrays do not use special class classes to represent triangles, but simply a simple list of integer exponents. Each triangle is set in groups of three, so the first three elements are defined as one triangle, the next three elements are defined as the second triangle, and so on.

An important detail of a triangle is the order of vertices at the corner. Although it does not matter which corner to start from, the vertices should be sorted so that when the visible outer surface of the triangle is looked down, each corner rotates clockwise.

It should also be known here what the UV coordinates represent.

Crawl Baidu Encyclopedia Information:

"UV" here refers to the short name of the u,v texture mapping coordinates (it is similar to the spatial Model X, Y, Z axis). It defines the information about the position of each point on the picture. These points are connected to the 3D model to determine the location of the surface texture map. UV is the exact correspondence of each point on the image to the surface of the model object.

Pull to UV coordinates, think of someone asked the material, map and texture what is the difference. In fact, in addition to see the Textures folder are graphics, and materials folder is a material ball outside, I do not know what the difference between the three. Yes, the material ball can be generated according to illumination, map, texture, and then thrown to the material attribute in the Gameobject render component.

The answers are as follows:

The three concepts in the whole CG field are similar, in general practice, the approximate hierarchical relationship is: material material contains map map, map contains texture Texture. Texture is the most basic data input unit, the game area is basically a bitmap. There is also a programmatic-generated texture procedural Texture. The map's English map actually contains another layer meaning "mapping." Its function is to map textures to 3D object surfaces through UV coordinates. The map contains a lot of information besides textures, such as UV coordinates, map input and output controls, and so on. A material is a data set, and the main function is to provide the renderer with data and lighting algorithms. Maps are part of the data and, depending on their purpose, the textures are divided into different types, such as diffuse map,specular map,normal map, Gloss map, and so on. Another important part is the illumination model Shader, which is used to achieve different rendering effects.

Yes, Unity automatically creates a skinned mesh Renderer if the imported model's mesh has skin information.

Note: You must provide a mesh renderer component when using the mesh filter, because it needs to be rendered, or you will not see him.

text Mesh : file filter for displaying the characters in the text.

mesh Renderer : Grid renderer. Displays the game object for the render grid.

The materials of the Mesh renderer can be placed in multiple posts to display the appearance of the game object.

Mesh properties [Unity]

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.