Created
November 23, 2013 20:14
-
-
Save radical/7619367 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int index = 0; | |
for (int face_i = 0; face_i < VertIndicesForFaces.Count; face_i ++) { | |
var face = VertIndicesForFaces [face_i]; | |
for (int vi = 0; vi < face.Length; vi ++) { | |
var v3d = new Vertex3d (vertices [face [vi]], Vector4f.Zero, c); | |
if (has_texcoords) | |
v3d.TexCoords = uv_coords [TexIndices [face_i][vi]]; | |
e.Vertices.Add (v3d); | |
} | |
// add indices | |
for (int i = 0; i < face.Length - 2; i ++) { | |
e.Indices.Add (index); | |
e.Indices.Add (index + i + 1); | |
e.Indices.Add (index + i + 2); | |
} | |
index += face.Length; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment