void MotionWindow_Loaded(object sender, RoutedEventArgs e) { UnitVisual3D uBase = new UnitVisual3D(); UnitVisual3D uPlatform = new UnitVisual3D(); UnitVisual3D upper = new UnitVisual3D(); Transform3DGroup gp = new Transform3DGroup(); uBase.Load(@"..\..\3DModules\upper.xaml"); ScaleTransform3D sc = new ScaleTransform3D(12, 12, 1, 0, 0, 0); TranslateTransform3D tt = new TranslateTransform3D(0, 0, -15.5); gp.Children.Add(sc); gp.Children.Add(tt); uBase.Transform = gp; uPlatform.Load(@"..\..\3DModules\platform.xaml"); upper.Load(@"..\..\3DModules\upper.xaml"); AbsoluteVisual.AddLight(Colors.Wheat, new Vector3D(-1, -1, -1), Colors.Gray); vpMain.PlaceCamera( new Point3D(0, 0, 500), new Vector3D(0, 0, -1), new Vector3D(0, 1, 0), 45 ); AbsoluteVisual.Children.Add(uBase); AbsoluteVisual.Children.Add(uPlatform); AbsoluteVisual.Children.Add(upper); ca = new EventCameraAgent(vpMain); ca.MouseLockRelPos = new Point(1, 1); ca.BindEventTo(this); ca.OnCameraStatusChange += new CameraAgent.CameraTransformHandler(ca_OnCameraStatusChange); }
//protected Model3DGroup hostGroup; //public ModelAgent(Model3DGroup group) //{ // hostGroup = group; // hostVisual = new UnitVisual3D(); // hostVisual.Content = group; //} public ModelAgent(UnitVisual3D unit) { hostVisual = unit; }
public WPFModelController(UnitVisual3D unit) { hostVisual = unit; }