public void ComputeFaceNormal(sMesh m) { sLine l0 = new sLine(m.vertices[this.A].location, m.vertices[this.B].location); sLine l1 = new sLine(m.vertices[this.A].location, m.vertices[this.C].location); this.normal = sXYZ.CrossProduct(l0.direction, l1.direction); }
public void ComputeNormal(sMesh m) { sXYZ nv = sXYZ.Zero(); foreach (int f in this.faceIndices) { nv += m.faces[f].normal; } this.normal = nv; }
public sMesh DuplicatesMesh() { sMesh nm = new sMesh(); nm.vertices = new List <sVertex>(); foreach (sVertex v in this.vertices) { nm.vertices.Add(v.DuplicatesVertex()); } nm.faces = new List <sFace>(); foreach (sFace f in this.faces) { nm.faces.Add(f.DuplicatesFace()); } nm.meshName = this.meshName; nm.data = this.data; nm.opacity = this.opacity; return(nm); }