public void Test2() { using (MaterialFormat mf = new MaterialFormat(@"C:\Temp\Default.mtl")) { mf.DefaultColors(); } using (WavefrontFormat wf = new WavefrontFormat(@"C:\Temp\Radio+.obj")) { wf.LoadMaterialLib("Default.mtl"); wf.DrawClotho(false, 10, "Red", "Yellow", "Green", "Magenta"); } using (WavefrontFormat wf = new WavefrontFormat(@"C:\Temp\Radio-.obj")) { wf.LoadMaterialLib("Default.mtl"); wf.DrawClotho(true, 10, "Blue", "Yellow", "Green", "Magenta"); } }
public static MaterialFormat DefaultColors(this MaterialFormat mf) { mf.AddMaterial(new MaterialFormat.Mat("Black", Color3f.FromRGB(0, 0, 0))); mf.AddMaterial(new MaterialFormat.Mat("White", Color3f.FromRGB(255, 255, 255))); mf.AddMaterial(new MaterialFormat.Mat("Red", Color3f.FromRGB(255, 0, 0))); mf.AddMaterial(new MaterialFormat.Mat("Lime", Color3f.FromRGB(0, 255, 0))); mf.AddMaterial(new MaterialFormat.Mat("Blue", Color3f.FromRGB(0, 0, 255))); mf.AddMaterial(new MaterialFormat.Mat("Yellow", Color3f.FromRGB(255, 255, 0))); mf.AddMaterial(new MaterialFormat.Mat("Cyan", Color3f.FromRGB(0, 255, 255))); // Aqua mf.AddMaterial(new MaterialFormat.Mat("Magenta", Color3f.FromRGB(255, 0, 255))); // Fuchsia mf.AddMaterial(new MaterialFormat.Mat("Silver", Color3f.FromRGB(192, 192, 192))); mf.AddMaterial(new MaterialFormat.Mat("Gray", Color3f.FromRGB(128, 128, 128))); mf.AddMaterial(new MaterialFormat.Mat("Maroon", Color3f.FromRGB(128, 0, 0))); mf.AddMaterial(new MaterialFormat.Mat("Olive", Color3f.FromRGB(128, 128, 0))); mf.AddMaterial(new MaterialFormat.Mat("Green", Color3f.FromRGB(0, 128, 0))); mf.AddMaterial(new MaterialFormat.Mat("Purple", Color3f.FromRGB(128, 0, 128))); mf.AddMaterial(new MaterialFormat.Mat("Teal", Color3f.FromRGB(0, 128, 128))); mf.AddMaterial(new MaterialFormat.Mat("Navy", Color3f.FromRGB(0, 0, 128))); return(mf); }