示例#1
0
        public Vec3 GetNormal()
        {
            var v1 = this.getVertexPosition(0);
            var v2 = this.getVertexPosition(1);
            var v3 = this.getVertexPosition(2);

            return(LinearAlgebra.GetNormal(v1, v2, v3));
        }
示例#2
0
        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();
        }
示例#3
0
 public Vec3 GetFaceCenter(Face faceToExtrude)
 {
     return(LinearAlgebra.GetCenter(faceToExtrude.GetVertexPositions()));
 }