20230724_MBJC_upperpc/Views/FirstPageView.xaml.cs
2023-12-18 17:31:28 +08:00

83 lines
2.6 KiB
C#

using _3DTools;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace _20230724_MBJC_upperpc.Views
{
/// <summary>
/// FirstPageView.xaml 的交互逻辑
/// </summary>
public partial class FirstPageView : UserControl
{
public FirstPageView()
{
InitializeComponent();
this.DataContext = MainWindow.viewModel;
}
private async void re(List<Single> End)
{
//await Task.Run(() =>
//{
// for (int i = 0; i < End.Count; i++)
// {
// float a = single.Rotate_X;
// float b = single.Rotate_Y;
// float c = single.Rotate_Z;
// for (int j = 0; j < 100; j++)
// {
// Thread.Sleep(10);
// single.Rotate_X += (End[i].Rotate_X - a) / 100;
// single.Rotate_Y += (End[i].Rotate_Y - b) / 100;
// single.Rotate_Z += (End[i].Rotate_Z - c) / 100;
// }
// }
// //for (int i = 0; i < 6000; i++)
// //{
// // Thread.Sleep(1);
// // //single.Rotate_X += 0.1f;
// // single.Rotate_Y += 0.1f;
// // //single.Rotate_Z += 0.1f;
// //}
//});
}
private void TrackballDecorator_MouseUp(object sender, MouseButtonEventArgs e)
{
Console.WriteLine();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
//re(new List<Single> { new Single() { Rotate_X = -180, Rotate_Y = -90, Rotate_Z = 0 },
//new Single() { Rotate_X = -90, Rotate_Y = -90, Rotate_Z = 0 },
//new Single() { Rotate_X = -90, Rotate_Y = -180, Rotate_Z = 0 },
//new Single() { Rotate_X = -90, Rotate_Y = -90, Rotate_Z = 0 },
//new Single() { Rotate_X = -90, Rotate_Y = -90, Rotate_Z = 90 },
//new Single() { Rotate_X = -90, Rotate_Y = -90, Rotate_Z = 0 }});
re(new List<Single> { new Single() { Rotate_X = -90f + 2.02f, Rotate_Y = -90f + 0.41f, Rotate_Z = 0.05f } });
}
}
}