public PMXLoader(string path) { using (FileStream sr = new FileStream(path, FileMode.Open, FileAccess.Read)) { using (BinaryReader bin = new BinaryReader(sr)) { PmxModelData = new PmxModelData(bin); PmxModelPath = path; //PmxModelData.Write( path + "ex.pmx" ); var vert = PmxModelData.VertexArray.Select(GetVert).ToArray(); IEnumerable <Material> mats = GetMat(PmxModelData); string parent = Directory.GetParent(path).FullName; MMDModel = new MMDModel(vert, mats, parent); MMDModel.SetMorph(VertexMorph.LoadVertMorphs(PmxModelData)); } } }
public LatticeForm(MMDModel model, SharpDevice device) { InitializeComponent( ); Lattice = new LatticeDef(model, new int[] { 4, 4, 4 }); //foreach ( var item in Lattice.LatticeData ) for (int i = 0; i < Lattice.LatticeData.Length; i++) { var item = Lattice.LatticeData[i]; var pos = item.Value.Position; SharpMesh mesh = SharpMesh.CreateQuad(device, 0.1f, true); ModelInWorld rectModel = ModelInWorld.Create(mesh, pos.TransMat( ), "../../HLSL.txt"); LatticePoint.Add(rectModel); rectModel.SetFaceFromSharpMesh("lattice" + i); } var lats = new[] { Lat0, Lat1, Lat2, Lat3, Lat4, Lat5, Lat6, Lat7, Lat8, }; for (int i = 0; i < lats.Length; i++) { #if true Lattice.LatticeString[i].BindTo(lats[i], x => x.Text, BindingMode.TwoWay, targetUpdateTrigger: ReactiveHelper.TextBoxChanged(lats[i])); #endif } LatticePointControl = new DraggableAxis("axis/axisold.csv"); }
public ClickState(MMDModel parent, ClickedAxis axis) { Axis = axis; Parent = parent; }