These are taken in groups of three for each triangle, so the first three elements define the first triangle, the next three define the second triangle, and so on. Rather than use a special class to represent a triangle the array is just a simple list of integer indices. The triangles are specified as triples of integers that act as indices into the vertex array. The UVs are specified as Vector2s, but since the Vector2 type doesn’t have fields called U and V, you must mentally convert them to X and Y respectively. The normals are normalised Vector3s representing the directions, again in local coordinates. The vertices are Vector3s representing points in the object’s local space. The vertices may be supplied in any order but the arrays of normals and UVs must be ordered so that the indices all correspond with the vertices (ie, element 0 of the normals array supplies the normal for vertex 0, etc). The Mesh object has properties for the vertices and their associated data (normals and UV coordinates) and also for the triangle data. if this gameObject has a MeshFilter, mf will reference the component Public class ExampleScript : MonoBehaviour This component is accessed using the familiar GetComponent function: using UnityEngine
More info See in Glossary component (and the object will also need a MeshRenderer to make the geometry visible). The mesh data is attached to an object using the Mesh Filter A mesh component that takes a mesh from your assets and passes it to the Mesh Renderer for rendering on the screen. It uses arrays to represent the triangles, vertex positions, normals and texture coordinates and also supplies a number of other useful properties and functions to assist mesh generation. More info See in Glossary class is the basic script interface to an object’s mesh geometry. Nurbs, Nurms, Subdiv surfaces must be converted to polygons. Unity supports triangulated or Quadrangulated polygon meshes. Meshes make up a large part of your 3D worlds. The Mesh The main graphics primitive of Unity.