public static void Dump(this TriangularMeshChunk chunk, ThreeDSModel4LegacyOpenGL model)
        {
            ThreeDSMesh4LegacyOpenGL mesh = new ThreeDSMesh4LegacyOpenGL();

            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);
        }
Ejemplo n.º 2
0
        public static void Dump(this TriangularMeshChunk chunk, ThreeDSModel4LegacyOpenGL model)
        {
            ThreeDSMesh4LegacyOpenGL mesh = new ThreeDSMesh4LegacyOpenGL();

            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, ThreeDSModel4LegacyOpenGL model, ThreeDSMesh4LegacyOpenGL 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, ThreeDSModel4LegacyOpenGL model,ThreeDSMesh4LegacyOpenGL mesh)
 {
     // nothing to do.
 }
Ejemplo n.º 5
0
 public static void Dump(this FacesMaterialChunk chunk, ThreeDSModel4LegacyOpenGL model, ThreeDSMesh4LegacyOpenGL mesh)
 {
     var tuple = new Tuple<string, ushort[]>(chunk.UsesMaterial, chunk.usesIndexes);
     mesh.usingMaterialIndexesList.Add(tuple);
 }
Ejemplo n.º 6
0
 public static void Dump(this LocalCoordinatesSystemChunk chunk, ThreeDSModel4LegacyOpenGL model, ThreeDSMesh4LegacyOpenGL mesh)
 {
     // nothing to do.
 }
 public static void Dump(this SmoothingGroupListChunk chunk, ThreeDSModel4LegacyOpenGL model, ThreeDSMesh4LegacyOpenGL mesh)
 {
     // nothing to do.
 }
Ejemplo n.º 8
0
 public static void Dump(this MappingCoordinatesListChunk chunk, ThreeDSModel4LegacyOpenGL model, ThreeDSMesh4LegacyOpenGL mesh)
 {
     mesh.TexCoords = chunk.texCoords;
 }
Ejemplo n.º 9
0
        public static void Dump(this FacesMaterialChunk chunk, ThreeDSModel4LegacyOpenGL model, ThreeDSMesh4LegacyOpenGL mesh)
        {
            var tuple = new Tuple <string, ushort[]>(chunk.UsesMaterial, chunk.usesIndexes);

            mesh.usingMaterialIndexesList.Add(tuple);
        }
Ejemplo n.º 10
0
 public static void Dump(this VerticesListChunk chunk, ThreeDSModel4LegacyOpenGL model, ThreeDSMesh4LegacyOpenGL mesh)
 {
     mesh.Vertexes = chunk.vertexes;
 }
        public static void Dump(this FacesDescriptionChunk chunk, ThreeDSModel4LegacyOpenGL model, ThreeDSMesh4LegacyOpenGL 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()));
                }
            }
        }