示例#1
0
        private void parseFace(String[] Args)
        {
            String[] Vtxs  = new String[3];
            String[] Norms = new String[3];

            Poly3 Face = new Poly3(new int[3]);

            for (int i = 0; i < 3; i++)
            {
                /* Split //'s */
                Vtxs[i]  = Args[i + 1].Split('/')[0];
                Norms[i] = Args[i + 1].Split('/')[2];

                /* Convert indices to ints */
                int VtxIndex  = System.Convert.ToInt16(Vtxs[i]) - 1;
                int NormIndex = System.Convert.ToInt16(Norms[i]) - 1;

                /* New face */
                Face.verts[i] = VtxIndex;

                /* Set Normal */
                vertices[VtxIndex].SetNormal(NormIndex);
            }

            tris.Add(Face);
        }
示例#2
0
        public List <DLVertex3> getVertices(Poly3 Tri)
        {
            List <DLVertex3> DLVertices = new List <DLVertex3> {
            };

            for (int i = 0; i < 3; i++)
            {
                Vertex3 Vtx  = vertices[Tri.verts[i]];
                Normal3 Norm = normals[Vtx.Normal];

                DLVertices.Add(new DLVertex3(Vtx, Norm));
            }

            return(DLVertices);
        }