Quantcast
Channel: Answers for "Creating a plane mesh directly from code"
Viewing all articles
Browse latest Browse all 7

Answer by Chris D

$
0
0
The documentation on the [Mesh][1] functions is pretty thorough. Point 1 has a code example to build a mesh from scratch: 1. Building a mesh from scratch: should always be done in the following order: 1) assign vertices 2) assign triangles var newVertices : Vector3[]; var newUV : Vector2[]; var newTriangles : int[]; function Start () { var mesh : Mesh = new Mesh (); GetComponent(MeshFilter).mesh = mesh; mesh.vertices = newVertices; mesh.uv = newUV; mesh.triangles = newTriangles; } [1]: http://unity3d.com/support/documentation/ScriptReference/Mesh.html

Viewing all articles
Browse latest Browse all 7

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>