示例#1
0
 public void UpdateVertexIndex(int oldIndex, int newIndex)
 {
     for (int index = 0; index < VertexIndexList.Count(); index++)
     {
         if (originalVertexIndexList[index] == oldIndex)
         {
             VertexIndexList[index] = newIndex;
             return;
         }
     }
 }
示例#2
0
        // HACKHACK this will write invalid files if there are no texture vertices in
        // the faces, need to identify that and write an alternate format
        public override string ToString()
        {
            StringBuilder b = new StringBuilder();

            b.Append("f");

            for (int i = 0; i < VertexIndexList.Count(); i++)
            {
                b.AppendFormat(" {0}/{1}", VertexIndexList[i], TextureVertexIndexList[i]);
            }

            return(b.ToString());
        }
示例#3
0
        public void UpdateVertexIndex(int oldIndex, int newIndex, bool retain = true)
        {
            for (int index = 0; index < VertexIndexList.Count(); index++)
            {
                if (originalVertexIndexList[index] == oldIndex)
                {
                    VertexIndexList[index] = newIndex;

                    if (!retain)
                    {
                        originalVertexIndexList[index] = newIndex;
                    }
                    return;
                }
            }
        }
示例#4
0
        // HACKHACK this will write invalid files if there are no texture vertices in
        // the faces, need to identify that and write an alternate format
        public override string ToString()
        {
            StringBuilder b = new StringBuilder();

            b.Append("f");

            for (int i = 0; i < VertexIndexList.Count(); i++)
            {
                if (i < TextureVertexIndexList.Length)
                {
                    b.AppendFormat(" {0}/{1}/{2}", VertexIndexList[i], TextureVertexIndexList[i], VertexNormalIndexList[i]);
                }
                else
                {
                    b.AppendFormat(" {0}", VertexIndexList[i]);
                }
            }

            return(b.ToString());
        }
示例#5
0
文件: Face.cs 项目: ja003/ForestReco2
        // HACKHACK this will write invalid files if there are no texture vertices in
        // the faces, need to identify that and write an alternate format
        public string ToString(int pVertexIndexOffset = 0)
        {
            StringBuilder b = new StringBuilder();

            b.Append("f");

            for (int i = 0; i < VertexIndexList.Count(); i++)
            {
                /*if (i < TextureVertexIndexList.Length)
                 * {
                 *      b.AppendFormat(" {0}/{1}",
                 *              VertexIndexList[i] + pVertexIndexOffset,
                 *              TextureVertexIndexList[i] + pVertexIndexOffset);
                 * }
                 * else
                 * {
                 *      b.AppendFormat(" {0}", VertexIndexList[i] + pVertexIndexOffset);
                 * }*/
                b.AppendFormat(" {0}", VertexIndexList[i] + pVertexIndexOffset);
            }

            return(b.ToString());
        }