public NyMmdMeshContainer(Device i_device, IMmdDataIo i_io, PmdMaterial[] i_pmd_materials) { this._texture_list = new D3dTextureList(i_device); List <Material> mats = new List <Material>(); List <Texture> texs = new List <Texture>(); for (int i = 0; i < i_pmd_materials.Length; i++) { Material m = new Material(); m.DiffuseColor = new ColorValue(i_pmd_materials[i].col4Diffuse.r, i_pmd_materials[i].col4Diffuse.g, i_pmd_materials[i].col4Diffuse.b, i_pmd_materials[i].col4Diffuse.a); m.AmbientColor = new ColorValue(i_pmd_materials[i].col4Ambient.r, i_pmd_materials[i].col4Ambient.g, i_pmd_materials[i].col4Ambient.b, i_pmd_materials[i].col4Ambient.a); m.SpecularColor = new ColorValue(i_pmd_materials[i].col4Specular.r, i_pmd_materials[i].col4Specular.g, i_pmd_materials[i].col4Specular.b, i_pmd_materials[i].col4Specular.a); m.SpecularSharpness = i_pmd_materials[i].fShininess; mats.Add(m); if (i_pmd_materials[i].texture_name != null) { texs.Add(this._texture_list.getTexture(i_pmd_materials[i].texture_name, i_io)); } else { texs.Add(null); } } this.texture = texs.ToArray(); this.material = mats.ToArray(); }
public MmdPmdRenderD3d(Device i_device) { this._texture_list = new D3dTextureList(i_device); this._device = i_device; return; }