public Vec3 GetNormal() { var v1 = this.getVertexPosition(0); var v2 = this.getVertexPosition(1); var v3 = this.getVertexPosition(2); return(LinearAlgebra.GetNormal(v1, v2, v3)); }
public Face(List <int> vertices, Model m) { this.vertices = vertices; this.model = m; Dictionary <Vec3, int> mapping = new Dictionary <Vec3, int>(); for (int i = 0; i < vertices.Count; i++) { int idx = vertices[i]; mapping[this.getVertexPosition(idx)] = idx; } var ordered = LinearAlgebra.OrderVertices(this.GetVertexPositions()); ordered.Reverse(); this.vertices = ordered.Select(i => mapping[i]).ToList(); }
public Vec3 GetFaceCenter(Face faceToExtrude) { return(LinearAlgebra.GetCenter(faceToExtrude.GetVertexPositions())); }