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); }
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); }
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 DiffuseColorChunk chunk, ThreeDSModel4ModernOpengl model, ThreeDSMaterial4ModernOpenGL material) { material.Diffuse = new float[] { chunk.R, chunk.G, chunk.B, }; }
public static void Dump(this SpecularColorChunk chunk, ThreeDSModel4ModernOpengl model, ThreeDSMaterial4ModernOpenGL material) { material.Specular = new float[] { chunk.R, chunk.G, chunk.B, }; }
public static void Dump(this BumpMapChunk chunk, ThreeDSModel4ModernOpengl model, ThreeDSMaterial4ModernOpenGL material) { // nothing to do. }
public static void Dump(this MappingFilenameChunk chunk, ThreeDSModel4ModernOpengl model, ThreeDSMaterial4ModernOpenGL material) { material.TextureFilename = chunk.TextureFilename; }
public static void Dump(this MaterialNameChunk chunk, ThreeDSModel4ModernOpengl model, ThreeDSMaterial4ModernOpenGL material) { material.MaterialName = chunk.MaterialName; }
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 MappingParametersChunk chunk, ThreeDSModel4ModernOpengl model, ThreeDSMaterial4ModernOpenGL material) { // nothing to do. }
public static void Dump(this MatShininessChunk chunk, ThreeDSModel4ModernOpengl model, ThreeDSMaterial4ModernOpenGL material) { material.Shininess = chunk.Shininess; }