◆ AverageVertices()
static Vertex pluginbase.Helpers.Mesh.Manipulation.SimpleSubdivide.AverageVertices |
( |
Vertex |
a, |
|
|
Vertex |
b |
|
) |
| |
|
static |
12 Coordinate = (a.Coordinate + b.Coordinate ) * 0.5f,
13 TexCoord = (a.TexCoord + b.TexCoord) * 0.5f,
14 Normal = (a.Normal + b.Normal) * 0.5f,
15 Color = (a.Color + b.Color) * 0.5f
◆ Subdivide()
static Mesh pluginbase.Helpers.Mesh.Manipulation.SimpleSubdivide.Subdivide |
( |
this Mesh |
mesh | ) |
|
|
static |
Attribute: mat
= mat.Clone();
Attribute: triangle.Material
: null;
21 var outMesh =
new Mesh();
23 var matMap =
new Dictionary<Material, Material>();
24 foreach(var mat
in mesh.Materials)
26 matMap[mat] = mat.Clone();
29 foreach(var triangle
in mesh.Triangles)
31 Vertex A = triangle.A.Clone();
32 Vertex B = triangle.B.Clone();
33 Vertex C = triangle.C.Clone();
37 Material mat = triangle.Material != null ? matMap[triangle.Material] : null;
39 outMesh.AddTriangle(A, D, F, mat);
40 outMesh.AddTriangle(D, B, E, mat);
41 outMesh.AddTriangle(F, E, C, mat);
42 outMesh.AddTriangle(D, E, F, mat);
static Vertex AverageVertices(Vertex a, Vertex b)
Definition: SimpleSubdivide.cs:8
The documentation for this class was generated from the following file: