Primitive Mesh Creation (square)
So, what I learned since a few days ago is a simple creation of square, which consists of only 4 vertices. Another understanding I could come out with is, how a texturable mesh could simply be product of vertices, triangles, normals, and uv information. At least this is what unity UnityEngine.Mesh really is. So, i'll try to in detail lay the explanation upon all these components. The example with be made with Vertices The coordinate(s) of the mesh's vertices in 3d space. Vector3 center = transform.position; Vector3 topLeft = new Vector3(center.x - Width / 2, center.y + Height / 2); Vector3 topRight = new Vector3(center.x + Width / 2, center.y + Height / 2); Vector3 bottomLeft = new Vector3(center.x - Width / 2, center.y - Height / 2); Vector3 bottomRight = new Vector3(center.x + Width / 2, center.y - Height / 2); mesh.vertices = new Vector3[4] { topLeft, topRight, bottomLeft, bottomRight }; The only information we could know in order to make up a square, is the ...