public static void Dump(this TriangularMeshChunk chunk, ThreeDSModel4ModernOpengl model) { ThreeDSMesh4ModernOpenGL mesh = new ThreeDSMesh4ModernOpenGL(); foreach (var item in chunk.Children) { if (item is VerticesListChunk) { (item as VerticesListChunk).Dump(model, mesh); } else if (item is FacesDescriptionChunk) { (item as FacesDescriptionChunk).Dump(model, mesh); } else if (item is MappingCoordinatesListChunk) { (item as MappingCoordinatesListChunk).Dump(model, mesh); } else if (item is LocalCoordinatesSystemChunk) { (item as LocalCoordinatesSystemChunk).Dump(model, mesh); } else if (!(item is UndefinedChunk)) { throw new NotImplementedException(string.Format( "not dumper implemented for {0}", item.GetType())); } } model.Entities.Add(mesh); }
public static void Dump(this FacesDescriptionChunk chunk, ThreeDSModel4ModernOpengl model, ThreeDSMesh4ModernOpenGL mesh) { mesh.TriangleIndexes = chunk.triangleIndexes; foreach (var item in chunk.Children) { if (item is FacesMaterialChunk) { (item as FacesMaterialChunk).Dump(model, mesh); } else if (item is SmoothingGroupListChunk) { (item as SmoothingGroupListChunk).Dump(model, mesh); } else if (!(item is UndefinedChunk)) { throw new NotImplementedException(string.Format( "not dumper implemented for {0}", item.GetType())); } } }
public static void Dump(this SmoothingGroupListChunk chunk, ThreeDSModel4ModernOpengl model,ThreeDSMesh4ModernOpenGL mesh) { // nothing to do. }
public static void Dump(this MappingCoordinatesListChunk chunk, ThreeDSModel4ModernOpengl model, ThreeDSMesh4ModernOpenGL mesh) { mesh.TexCoords = chunk.texCoords; }
public static void Dump(this FacesMaterialChunk chunk, ThreeDSModel4ModernOpengl model, ThreeDSMesh4ModernOpenGL mesh) { mesh.UsesMaterial = chunk.UsesMaterial; mesh.UsesIndexes = chunk.usesIndexes; }
public static void Dump(this LocalCoordinatesSystemChunk chunk, ThreeDSModel4ModernOpengl model, ThreeDSMesh4ModernOpenGL mesh) { // nothing to do. }
public static void Dump(this VerticesListChunk chunk, ThreeDSModel4ModernOpengl model, ThreeDSMesh4ModernOpenGL mesh) { mesh.Vertexes = chunk.vertexes; }
public static void Dump(this SmoothingGroupListChunk chunk, ThreeDSModel4ModernOpengl model, ThreeDSMesh4ModernOpenGL mesh) { // nothing to do. }