The vertices array. Either xy pairs, or xyz if the containsZ parameter is true.
The UVs pairs array.
Optionalindicies: number[]Optional vertex indicies array. If you don't have one, pass null or an empty array.
OptionalcontainsZ: booleanDoes the vertices data include a z component? Default false.
Optionalnormals: number[]Optional vertex normals array. If you don't have one, pass null or an empty array.
Optionalcolors: number | number[]An array of colors, one per vertex, or a single color value applied to all vertices. Default 0xffffff.
Optionalalphas: number | number[]An array of alpha values, one per vertex, or a single alpha value applied to all vertices. Default 1.
OptionalflipUV: booleanFlip the UV coordinates? Default false.
Generates a set of Face and Vertex objects by parsing the given data.
This method will take vertex data in one of two formats, based on the
containsZparameter.If your vertex data are
x,ypairs, thencontainsZshould befalse(this is the default)If your vertex data is groups of
x,yandzvalues, then thecontainsZparameter must be true.The
uvsparameter is a numeric array consisting ofuandvpairs.The
normalsparameter is a numeric array consisting ofx,yvertex normal values and, ifcontainsZis true,zvalues as well.The
indiciesparameter is an optional array that, if given, is an indexed list of vertices to be added.The
colorsparameter is an optional array, or single value, that if given sets the color of each vertex created.The
alphasparameter is an optional array, or single value, that if given sets the alpha of each vertex created.When providing indexed data it is assumed that all of the arrays are indexed, not just the vertices.
The following example will create a 256 x 256 sized quad using an index array:
If the data is not indexed, it's assumed that the arrays all contain sequential data.