public static ModelInWorld Create(SharpMesh mesh, Matrix world, string shaderPath) { var temp = new ModelInWorld( ) { Mesh = mesh, World = world, }; temp.PrepareShader(mesh.Device, shaderPath); return(temp); }
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"); }