Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        public static void Dump(this MainChunk chunk, out ThreeDSModel4ModernOpengl model)
        {
            model = new ThreeDSModel4ModernOpengl();

            foreach (var item in chunk.Children)
            {
                if(item is VersionChunk)
                {
                    (item as VersionChunk).Dump(model);
                }
                else if(item is _3DEditorChunk)
                {
                    (item as _3DEditorChunk).Dump(model);
                }
                else if (item is KeyframeChunk)
                {
                    (item as KeyframeChunk).Dump(model);
                }
                else if(!(item is UndefinedChunk))
                {
                    throw new NotImplementedException(string.Format(
                        "not dumper implemented for {0}", item.GetType()));
                }
            }
        }
Ejemplo n.º 3
0
 public static void Dump(this FramesChunk chunk, ThreeDSModel4ModernOpengl model)
 {
     foreach (var item in chunk.Children)
     {
         if (item is ObjectNameChunk)
         {
             (item as ObjectNameChunk).Dump(model);
         }
         else if (item is ObjectPivotPointChunk)
         {
             (item as ObjectPivotPointChunk).Dump(model);
         }
         else if (item is PositionTrackChunk)
         {
             (item as PositionTrackChunk).Dump(model);
         }
         else if (item is RotationTrackChunk)
         {
             (item as RotationTrackChunk).Dump(model);
         }
         else if (item is ScaleTrackChunk)
         {
             (item as ScaleTrackChunk).Dump(model);
         }
         else if (item is HierarchyPositionChunk)
         {
             (item as HierarchyPositionChunk).Dump(model);
         }
         else if (!(item is UndefinedChunk))
         {
             throw new NotImplementedException(string.Format(
                                                   "not dumper implemented for {0}", item.GetType()));
         }
     }
 }
        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);
        }
Ejemplo n.º 5
0
        public static void Dump(this MainChunk chunk, out ThreeDSModel4ModernOpengl model)
        {
            model = new ThreeDSModel4ModernOpengl();

            foreach (var item in chunk.Children)
            {
                if (item is VersionChunk)
                {
                    (item as VersionChunk).Dump(model);
                }
                else if (item is _3DEditorChunk)
                {
                    (item as _3DEditorChunk).Dump(model);
                }
                else if (item is KeyframeChunk)
                {
                    (item as KeyframeChunk).Dump(model);
                }
                else if (!(item is UndefinedChunk))
                {
                    throw new NotImplementedException(string.Format(
                                                          "not dumper implemented for {0}", item.GetType()));
                }
            }
        }
Ejemplo n.º 6
0
 public static void Dump(this FramesChunk chunk, ThreeDSModel4ModernOpengl model)
 {
     foreach (var item in chunk.Children)
     {
         if (item is ObjectNameChunk)
         {
             (item as ObjectNameChunk).Dump(model);
         }
         else if (item is ObjectPivotPointChunk)
         {
             (item as ObjectPivotPointChunk).Dump(model);
         }
         else if (item is PositionTrackChunk)
         {
             (item as PositionTrackChunk).Dump(model);
         }
         else if (item is RotationTrackChunk)
         {
             (item as RotationTrackChunk).Dump(model);
         }
         else if (item is ScaleTrackChunk)
         {
             (item as ScaleTrackChunk).Dump(model);
         }
         else if (item is HierarchyPositionChunk)
         {
             (item as HierarchyPositionChunk).Dump(model);
         }
         else if (!(item is UndefinedChunk))
         {
             throw new NotImplementedException(string.Format(
                 "not dumper implemented for {0}", item.GetType()));
         }
     }
 }
Ejemplo n.º 7
0
 public static void Dump(this LightChunk chunk, ThreeDSModel4ModernOpengl model)
 {
     foreach (var item in chunk.Children)
     {
         if(item is SpotlightChunk)
         {
             (item as SpotlightChunk).Dump(model);
         }
         else if (!(item is UndefinedChunk))
         {
             throw new NotImplementedException(string.Format(
                 "not dumper implemented for {0}", item.GetType()));
         }
     }
 }
Ejemplo n.º 8
0
 public static void Dump(this LightChunk chunk, ThreeDSModel4ModernOpengl model)
 {
     foreach (var item in chunk.Children)
     {
         if (item is SpotlightChunk)
         {
             (item as SpotlightChunk).Dump(model);
         }
         else if (!(item is UndefinedChunk))
         {
             throw new NotImplementedException(string.Format(
                                                   "not dumper implemented for {0}", item.GetType()));
         }
     }
 }
Ejemplo n.º 9
0
        public static void Dump(this MaterialBlockChunk chunk, ThreeDSModel4ModernOpengl model)
        {
            ThreeDSMaterial4ModernOpenGL material = new ThreeDSMaterial4ModernOpenGL();

            foreach (var item in chunk.Children)
            {
                if(item is MaterialNameChunk)
                {
                    (item as MaterialNameChunk).Dump(model, material);
                }
                else if(item is AmbientColorChunk)
                {
                    (item as AmbientColorChunk).Dump(model, material);
                }
                else if (item is DiffuseColorChunk)
                {
                    (item as DiffuseColorChunk).Dump(model, material);
                }
                else if(item is SpecularColorChunk)
                {
                    (item as SpecularColorChunk).Dump(model, material);
                }
                else if(item is MatShininessChunk)
                {
                    (item as MatShininessChunk).Dump(model, material);
                }
                else if(item is TextureMapChunk)
                {
                    (item as TextureMapChunk).Dump(model, material);
                }
                else if(item is BumpMapChunk)
                {
                    (item as BumpMapChunk).Dump(model, material);
                }
                else if(item is ReflectionMapChunk)
                {
                    (item as ReflectionMapChunk).Dump(model, material);
                }
                else if (!(item is UndefinedChunk))
                {
                    throw new NotImplementedException(string.Format(
                        "not dumper implemented for {0}", item.GetType()));
                }
            }

            model.MaterialDict.Add(material.MaterialName, material);
        }
Ejemplo n.º 10
0
        public static void Dump(this MaterialBlockChunk chunk, ThreeDSModel4ModernOpengl model)
        {
            ThreeDSMaterial4ModernOpenGL material = new ThreeDSMaterial4ModernOpenGL();

            foreach (var item in chunk.Children)
            {
                if (item is MaterialNameChunk)
                {
                    (item as MaterialNameChunk).Dump(model, material);
                }
                else if (item is AmbientColorChunk)
                {
                    (item as AmbientColorChunk).Dump(model, material);
                }
                else if (item is DiffuseColorChunk)
                {
                    (item as DiffuseColorChunk).Dump(model, material);
                }
                else if (item is SpecularColorChunk)
                {
                    (item as SpecularColorChunk).Dump(model, material);
                }
                else if (item is MatShininessChunk)
                {
                    (item as MatShininessChunk).Dump(model, material);
                }
                else if (item is TextureMapChunk)
                {
                    (item as TextureMapChunk).Dump(model, material);
                }
                else if (item is BumpMapChunk)
                {
                    (item as BumpMapChunk).Dump(model, material);
                }
                else if (item is ReflectionMapChunk)
                {
                    (item as ReflectionMapChunk).Dump(model, material);
                }
                else if (!(item is UndefinedChunk))
                {
                    throw new NotImplementedException(string.Format(
                                                          "not dumper implemented for {0}", item.GetType()));
                }
            }

            model.MaterialDict.Add(material.MaterialName, material);
        }
Ejemplo n.º 11
0
 public static void Dump(this ReflectionMapChunk chunk, ThreeDSModel4ModernOpengl model, ThreeDSMaterial4ModernOpenGL material)
 {
     foreach (var item in chunk.Children)
     {
         if (item is MappingFilenameChunk)
         {
             (item as MappingFilenameChunk).Dump(model, material);
         }
         else if (item is MappingParametersChunk)
         {
             (item as MappingParametersChunk).Dump(model, material);
         }
         else if (!(item is UndefinedChunk))
         {
             throw new NotImplementedException(string.Format(
                                                   "not dumper implemented for {0}", item.GetType()));
         }
     }
 }
Ejemplo n.º 12
0
 public static void Dump(this ReflectionMapChunk chunk, ThreeDSModel4ModernOpengl model, ThreeDSMaterial4ModernOpenGL material)
 {
     foreach (var item in chunk.Children)
     {
         if(item is MappingFilenameChunk)
         {
             (item as MappingFilenameChunk).Dump(model, material);
         }
         else if(item is MappingParametersChunk)
         {
             (item as MappingParametersChunk).Dump(model, material);
         }
         else if (!(item is UndefinedChunk))
         {
             throw new NotImplementedException(string.Format(
                 "not dumper implemented for {0}", item.GetType()));
         }
     }
 }
        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()));
                }
            }
        }
Ejemplo n.º 14
0
        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()));
                }
            }
        }
Ejemplo n.º 15
0
 public static void Dump(this MappingParametersChunk chunk, ThreeDSModel4ModernOpengl model, ThreeDSMaterial4ModernOpenGL material)
 {
     // nothing to do.
 }
 public static void Dump(this HierarchyPositionChunk chunk, ThreeDSModel4ModernOpengl model)
 {
     // nothing to do.
 }
Ejemplo n.º 17
0
 public static void Dump(this CameraChunk chunk, ThreeDSModel4ModernOpengl model)
 {
     // nothing to do.
 }
Ejemplo n.º 18
0
 public static void Dump(this SpotlightChunk chunk, ThreeDSModel4ModernOpengl model)
 {
     // nothing to do.
 }
Ejemplo n.º 19
0
 public static void Dump(this BumpMapChunk chunk, ThreeDSModel4ModernOpengl model, ThreeDSMaterial4ModernOpenGL material)
 {
     // nothing to do.
 }
Ejemplo n.º 20
0
 public static void Dump(this PositionTrackChunk chunk, ThreeDSModel4ModernOpengl model)
 {
     // nothing to do.
 }
Ejemplo n.º 21
0
 public static void Dump(this SpecularColorChunk chunk, ThreeDSModel4ModernOpengl model, ThreeDSMaterial4ModernOpenGL material)
 {
     material.Specular = new float[] { chunk.R, chunk.G, chunk.B, };
 }
Ejemplo n.º 22
0
 public static void Dump(this DiffuseColorChunk chunk, ThreeDSModel4ModernOpengl model, ThreeDSMaterial4ModernOpenGL material)
 {
     material.Diffuse = new float[] { chunk.R, chunk.G, chunk.B, };
 }
Ejemplo n.º 23
0
 public static void Dump(this MatShininessChunk chunk, ThreeDSModel4ModernOpengl model, ThreeDSMaterial4ModernOpenGL material)
 {
     material.Shininess = chunk.Shininess;
 }
Ejemplo n.º 24
0
 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.
 }
Ejemplo n.º 26
0
 public static void Dump(this VerticesListChunk chunk, ThreeDSModel4ModernOpengl model, ThreeDSMesh4ModernOpenGL mesh)
 {
     mesh.Vertexes = chunk.vertexes;
 }
Ejemplo n.º 27
0
 public static void Dump(this FacesMaterialChunk chunk, ThreeDSModel4ModernOpengl model, ThreeDSMesh4ModernOpenGL mesh)
 {
     mesh.UsesMaterial = chunk.UsesMaterial;
     mesh.UsesIndexes  = chunk.usesIndexes;
 }
Ejemplo n.º 28
0
 public static void Dump(this MeshInformationBlockChunk chunk, ThreeDSModel4ModernOpengl model)
 {
     // nothing to do.
 }
 public static void Dump(this MappingCoordinatesListChunk chunk, ThreeDSModel4ModernOpengl model, ThreeDSMesh4ModernOpenGL mesh)
 {
     mesh.TexCoords = chunk.texCoords;
 }
 public static void Dump(this SmoothingGroupListChunk chunk, ThreeDSModel4ModernOpengl model, ThreeDSMesh4ModernOpenGL mesh)
 {
     // nothing to do.
 }
Ejemplo n.º 31
0
 public static void Dump(this VersionChunk chunk, ThreeDSModel4ModernOpengl model)
 {
     Console.WriteLine("version:" + chunk.Version);
 }
Ejemplo n.º 32
0
 public static void Dump(this ObjectNameChunk chunk, ThreeDSModel4ModernOpengl model)
 {
     Console.WriteLine("Object Name: " + chunk.Name);
 }
 public static void Dump(this SmoothingGroupListChunk chunk, ThreeDSModel4ModernOpengl model,ThreeDSMesh4ModernOpenGL mesh)
 {
     // nothing to do.
 }
 public static void Dump(this MappingFilenameChunk chunk, ThreeDSModel4ModernOpengl model, ThreeDSMaterial4ModernOpenGL material)
 {
     material.TextureFilename = chunk.TextureFilename;
 }
Ejemplo n.º 35
0
 public static void Dump(this MaterialNameChunk chunk, ThreeDSModel4ModernOpengl model, ThreeDSMaterial4ModernOpenGL material)
 {
     material.MaterialName = chunk.MaterialName;
 }
 public static void Dump(this ObjectPivotPointChunk chunk, ThreeDSModel4ModernOpengl model)
 {
     // nothing to do.
 }