Hi, guys!
I try to create mesh in 2D game (I need a complex sprite shape):
Mesh mesh = new Mesh();
mesh.name = "PolygonMesh";
mesh.vertices = new Vector3[] {
new Vector3(-1f, -1f, 0f),
new Vector3(1f, -1f, 0f),
new Vector3(1f, 1f, 0f),
new Vector3(-1f, 1f, 0f)
};
mesh.uv = new Vector2[] {
new Vector2 (0, 0),
new Vector2 (0, 1),
new Vector2 (1, 1),
new Vector2 (1, 0)
};
mesh.triangles = new int[] { 0, 1, 2, 0, 2, 3 };
mesh.RecalculateNormals();
But this mesh has a face side that is inverted toward to another scene’s objects. Of course, I can rotate it on 180 deg. by Y-axis but I want create it already inversed to reduce additional transform calculations for rotating. How to make it?
Yeah, thank you! But can you explain me, pls? Why it so? How to vertex path order influences on the face side?
Maybe it has a lot of information but I don’t know how it is called to find.