Exemplo n.º 1
0
        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");
        }
Exemplo n.º 2
0
        public BarControl(string morphName)
        {
            InitializeComponent( );
            //Lattice.LatticeString[ i ].BindTo( lats[ i ] , x=>x.Text , BindingMode.TwoWay ,
            //	targetUpdateTrigger: ReactiveHelper.TextBoxChanged( lats[ i ] ) );

            Coef.BindTo(trackBar, x => x.Value, BindingMode.TwoWay, targetUpdateTrigger: ReactiveHelper.BarChanged(trackBar));
            MorphName  = morphName;
            label.Text = MorphName;
        }