Exemple #1
0
        /// <summary>
        /// 将给定三角形的顶点添加到顶点查找字典并发出三角形。
        /// Add the vertices of the given triangle to our
        /// vertex lookup dictionary and emit a triangle.
        /// </summary>
        void StoreTriangle(MeshTriangle triangle, ObjModel objModel)
        {
            var vFace = new VFace();

            for (int i = 0; i < 3; ++i)
            {
                XYZ p = triangle.get_Vertex(i);

                if (i == 0)
                {
                    vFace.Point1 = _vertices.AddVertex(new PointInt(p)) + 1;
                }
                else if (i == 1)
                {
                    vFace.Point2 = _vertices.AddVertex(new PointInt(p)) + 1;
                }
                else if (i == 2)
                {
                    vFace.Point3 = _vertices.AddVertex(new PointInt(p)) + 1;
                }
            }

            // 添加面数据
            objModel.Faces.Add(vFace);
        }
Exemple #2
0
 /// <summary>
 /// Add the vertices of the given triangle to our
 /// vertex lookup dictionary and emit a triangle.
 /// </summary>
 void StoreTriangle(MeshTriangle triangle)
 {
     for (int i = 0; i < 3; ++i)
     {
         XYZ      p = triangle.get_Vertex(i);
         PointInt q = new PointInt(p);
         _triangles.Add(_vertices.AddVertex(q));
     }
 }