public void UpdateVertexIndex(int oldIndex, int newIndex) { for (int index = 0; index < VertexIndexList.Count(); index++) { if (originalVertexIndexList[index] == oldIndex) { VertexIndexList[index] = newIndex; return; } } }
// 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()); }
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; } } }
// 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()); }
// 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()); }