Home › Page › UghTriangle

UghTriangle

Revision for “UghTriangle” created on 17 April, 2013 @ 19:02

Title
UghTriangle
Content
UghTriangle is a helper class used chiefly by UghSprite to construct meshes.  It can be useful outside of UghSprite to aid in constructing custom meshes. [table caption="Variables" colwidth="20%|20%"] name, type, description points, Vector3[], The points of the triangle uvs, Vector2[], The uvs of the triangle [/table] [table caption="Constructors" colwidth="20%|20%"] name, type, description UghTriangle, , Creates a new UghTriangle from parameters [/table] [table caption="Functions" colwidth="20%|20%"] name, type, description AddToMeshList, void, Adds this triangle to the class mesh list MakeQuad, UghTriangle[], Makes and returns a new quad (composed of UghTriangles) [/table] <strong>Using UghTriangle in Script</strong> [sourcecode language="csharp"]public void AddToMeshList(ref Vector3[] vertList, ref int[] triList, ref Vector2[] uvList)[/sourcecode] This function aids in constructing a mesh by filling data in to the supplied arrays.  The supplied arrays will be expanded (as needed) to include the vertices of the UghTriangle instance. [sourcecode language="csharp"]static public UghTriangle[] MakeQuad(Vector3 topLeft, Vector2 topLeftUV, Vector3 bottomRight, Vector2 bottomRightUV)[/sourcecode] Given top-left and bottom-right coordinates, this static function will output an array of UghTriangles that form a rectangle.  The coordinates are in Unity units.
Excerpt


OldNewDate CreatedAuthorActions
17 April, 2013 @ 19:02 admin
2 April, 2013 @ 15:19 [Autosave] admin
2 April, 2013 @ 15:18 admin
2 April, 2013 @ 15:13 admin
2 April, 2013 @ 15:12 admin
18 March, 2013 @ 20:29 admin
18 March, 2013 @ 16:09 admin
18 March, 2013 @ 16:07 admin
18 March, 2013 @ 16:06 admin
18 March, 2013 @ 16:05 admin
8 March, 2013 @ 21:21 admin
8 March, 2013 @ 21:21 admin
8 March, 2013 @ 16:20 admin
8 March, 2013 @ 16:14 admin
6 March, 2013 @ 21:50 admin
6 March, 2013 @ 21:50 admin